Skip to content

Commit b526de0

Browse files
joergroedelgregkh
authored andcommitted
ACPI: ioapic: Clear on-stack resource before using it
commit e3d5092b6756b9e0b08f94bbeafcc7afe19f0996 upstream. The on-stack resource-window 'win' in setup_res() is not properly initialized. This causes the pointers in the embedded 'struct resource' to contain stale addresses. These pointers (in my case the ->child pointer) later get propagated to the global iomem_resources list, causing a #GP exception when the list is traversed in iomem_map_sanity_check(). Fixes: c183619 (x86/irq, ACPI: Implement ACPI driver to support IOAPIC hotplug) Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 4e5f2c2 commit b526de0

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/acpi/ioapic.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ static acpi_status setup_res(struct acpi_resource *acpi_res, void *data)
4545
struct resource *res = data;
4646
struct resource_win win;
4747

48+
/*
49+
* We might assign this to 'res' later, make sure all pointers are
50+
* cleared before the resource is added to the global list
51+
*/
52+
memset(&win, 0, sizeof(win));
53+
4854
res->flags = 0;
4955
if (acpi_dev_filter_resource_type(acpi_res, IORESOURCE_MEM) == 0)
5056
return AE_OK;

0 commit comments

Comments
 (0)