linux-stable/arch/x86/platform
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
..
atom x86/cpu: Sanitize FAM6_ATOM naming 2019-05-14 19:17:53 +02:00
ce4100 x86/init: Remove i8042_detect() from platform ops 2016-12-19 11:34:15 +01:00
efi efi/x86: Fix the deletion of variables in mixed mode 2020-04-17 10:48:55 +02:00
geode x86/platform: Make platform/geode/net5501.c explicitly non-modular 2016-02-16 09:11:09 +01:00
goldfish x86/platform/goldfish: Prevent unconditional loading 2017-02-15 08:49:58 -08:00
intel x86/platform/intel/iosf_mbi: Add unlocked PMIC bus access notifier unregister 2017-11-10 13:14:02 +01:00
intel-mid x86/cpu: Sanitize FAM6_ATOM naming 2019-05-14 19:17:53 +02:00
intel-quark x86/platform/quark: Re-use DEFINE_SHOW_ATTRIBUTE() macro 2018-02-16 10:10:14 +01:00
iris
olpc x86/olpc: Indicate that legacy PC XO-1 platform should not register RTC 2018-11-13 11:08:23 -08:00
scx200
sfi x86: Cleanup irq_domain ops 2015-04-24 15:36:55 +02:00
ts5500 x86/platform: Delete extraneous MODULE_* tags fromm ts5500 2016-07-16 22:41:00 +02:00
uv irqdomain/treewide: Keep firmware node unconditionally allocated 2020-07-29 10:16:46 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00