linux/arch
Thomas Gleixner c0c489e543 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:16:46 +02:00
..
alpha scsi: sr: remove references to BLK_DEV_SR_VENDOR, leave it enabled 2020-07-22 09:32:04 +02:00
arc ARC: elf: use right ELF_ARCH 2020-07-16 08:17:27 +02:00
arm ARM: dts: socfpga: Align L2 cache-controller nodename with dtschema 2020-07-22 09:32:06 +02:00
arm64 arm64: compat: Ensure upper 32 bits of x0 are zero on syscall return 2020-07-22 09:32:13 +02:00
c6x
h8300
hexagon hexagon: define ioremap_uc 2020-05-10 10:30:11 +02:00
ia64 scsi: sr: remove references to BLK_DEV_SR_VENDOR, leave it enabled 2020-07-22 09:32:04 +02:00
m68k scsi: sr: remove references to BLK_DEV_SR_VENDOR, leave it enabled 2020-07-22 09:32:04 +02:00
microblaze microblaze: Prevent the overflow of the start 2020-02-24 08:34:53 +01:00
mips MIPS: Fix build for LTS kernel caused by backporting lpj adjustment 2020-07-22 09:32:11 +02:00
nds32
nios2
openrisc openrisc: Fix issue with argument clobbering for clone/fork 2020-06-25 15:33:01 +02:00
parisc parisc: Fix kernel panic in mem_init() 2020-06-03 08:19:42 +02:00
powerpc powerpc/book3s64/pkeys: Fix pkey_access_permitted() for execute disable pkey 2020-07-22 09:32:11 +02:00
riscv riscv: use 16KB kernel stack on 64-bit 2020-07-22 09:32:11 +02:00
s390 s390/mm: fix huge pte soft dirty copying 2020-07-16 08:17:28 +02:00
sh scsi: sr: remove references to BLK_DEV_SR_VENDOR, leave it enabled 2020-07-22 09:32:04 +02:00
sparc scsi: sr: remove references to BLK_DEV_SR_VENDOR, leave it enabled 2020-07-22 09:32:04 +02:00
um um: ubd: Prevent buffer overrun on command completion 2020-04-23 10:30:19 +02:00
unicore32
x86 irqdomain/treewide: Keep firmware node unconditionally allocated 2020-07-29 10:16:46 +02:00
xtensa xtensa: update *pos in cpuinfo_op.next 2020-07-29 10:16:45 +02:00
.gitignore
Kconfig