1
0
Fork 0
alistair23-linux/drivers/pci
Thomas Gleixner 36f7355545 irqdomain/treewide: Keep firmware node unconditionally allocated
[ Upstream commit e3beca48a4 ]

Quite some non OF/ACPI users of irqdomains allocate firmware nodes of type
IRQCHIP_FWNODE_NAMED or IRQCHIP_FWNODE_NAMED_ID and free them right after
creating the irqdomain. The only purpose of these FW nodes is to convey
name information. When this was introduced the core code did not store the
pointer to the node in the irqdomain. A recent change stored the firmware
node pointer in irqdomain for other reasons and missed to notice that the
usage sites which do the alloc_fwnode/create_domain/free_fwnode sequence
are broken by this. Storing a dangling pointer is dangerous itself, but in
case that the domain is destroyed later on this leads to a double free.

Remove the freeing of the firmware node after creating the irqdomain from
all affected call sites to cure this.

Fixes: 711419e504 ("irqdomain: Add the missing assignment of domain->fwnode for named fwnode")
Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/873661qakd.fsf@nanos.tec.linutronix.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-07-29 10:18:28 +02:00
..
controller irqdomain/treewide: Keep firmware node unconditionally allocated 2020-07-29 10:18:28 +02:00
endpoint PCI: endpoint: Fix for concurrent memory allocation in OB address region 2020-04-17 10:50:11 +02:00
hotplug PCI: pciehp: Prevent deadlock on disconnect 2020-04-29 16:33:04 +02:00
pcie PCI/PTM: Inherit Switch Downstream Port PTM settings from Upstream Port 2020-06-24 17:50:31 +02:00
switch PCI/switchtec: Fix init_completion race condition with poll_wait() 2020-04-17 10:50:02 +02:00
Kconfig pci-v5.4-changes 2019-09-23 19:16:01 -07:00
Makefile PCI: OF: Allow of_pci_get_max_link_speed() to be used by PCI Endpoint drivers 2019-04-15 13:24:02 +01:00
access.c PCI: Make pcie_downstream_port() available outside of access.c 2019-09-07 07:45:25 -05:00
ats.c PCI: Fix typos and whitespace errors 2019-07-09 07:24:53 -05:00
bus.c PCI: Unexport pci_bus_get() and pci_bus_put() 2019-07-23 18:32:49 -05:00
ecam.c
host-bridge.c
iov.c PCI/IOV: Fix memory leak in pci_iov_add_virtfn() 2020-02-14 16:34:08 -05:00
irq.c PCI: Use IRQF_ONESHOT if pci_request_irq() called with no handler 2018-07-31 10:43:43 -05:00
mmap.c PCI: Fix typos and whitespace errors 2019-07-09 07:24:53 -05:00
msi.c PCI/MSI: Fix incorrect MSI-X masking on resume 2019-12-21 11:04:28 +01:00
of.c PCI: OF: Correct of_irq_parse_pci() documentation 2019-08-30 14:00:34 -05:00
p2pdma.c PCI/P2PDMA: Update pci_p2pdma_distance_many() documentation 2019-08-16 08:41:59 -05:00
pci-acpi.c Merge branch 'pci/enumeration' 2019-09-23 16:10:08 -05:00
pci-bridge-emul.c PCI: pci-bridge-emul: Fix PCIe bit conflicts 2020-06-24 17:50:15 +02:00
pci-bridge-emul.h PCI: pci-bridge-emul: Extend pci_bridge_emul_init() with flags 2019-02-22 10:51:14 +00:00
pci-driver.c PCI/PM: Add missing link delays required by the PCIe spec 2020-04-29 16:33:06 +02:00
pci-label.c
pci-mid.c x86/cpu: Sanitize FAM6_ATOM naming 2018-10-02 10:14:32 +02:00
pci-pf-stub.c PCI: Fix typos and whitespace errors 2019-07-09 07:24:53 -05:00
pci-stub.c PCI: Replace printk(KERN_INFO) with pr_info(), etc 2019-05-09 07:49:54 -05:00
pci-sysfs.c PCI: sysfs: Revert "rescan" file renames 2020-04-08 09:08:42 +02:00
pci.c PCI/PM: Call .bridge_d3() hook only if non-NULL 2020-07-22 09:33:05 +02:00
pci.h PCI/PM: Add missing link delays required by the PCIe spec 2020-04-29 16:33:06 +02:00
probe.c PCI: Fix pci_register_host_bridge() device_register() error handling 2020-06-24 17:50:27 +02:00
proc.c Merge branch 'next-lockdown' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2019-09-28 08:14:15 -07:00
quirks.c PCI: Add ACS quirk for Intel Root Complex Integrated Endpoints 2020-06-22 09:31:16 +02:00
remove.c PCI/ASPM: Fix link_state teardown on device removal 2018-09-17 16:32:23 -05:00
rom.c PCI: Make pci_get_rom_size() static 2018-06-29 21:17:26 -05:00
search.c PCI: Fix pci_add_dma_alias() bitmask size 2020-02-24 08:36:24 +01:00
setup-bus.c PCI: Don't disable bridge BARs when assigning bus resources 2020-02-14 16:34:09 -05:00
setup-irq.c
setup-res.c PCI: Allow pci_resize_resource() for devices on root bus 2020-06-24 17:50:11 +02:00
slot.c PCI: Decode PCIe 32 GT/s link speed 2019-06-13 16:49:45 -05:00
syscall.c PCI: Lock down BAR access when the kernel is locked down 2019-08-19 21:54:15 -07:00
vc.c Merge branch 'pci/trivial' 2019-09-23 16:10:31 -05:00
vpd.c PCI/VPD: Prevent VPD access for Amazon's Annapurna Labs Root Port 2019-09-16 14:10:09 +01:00
xen-pcifront.c Merge branch 'pci/printk' 2019-05-13 18:34:46 -05:00