Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1606802 > unrolled thread

[PATCH 1/3] ACPI, ioapic: Clear on-stack resource before using it

Started byJoerg Roedel <joro@8bytes.org>
First post2017-03-22 18:40 +0100
Last post2017-03-22 18:40 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/3] ACPI, ioapic: Clear on-stack resource before using it Joerg Roedel <joro@8bytes.org> - 2017-03-22 18:40 +0100

#1606802 — [PATCH 1/3] ACPI, ioapic: Clear on-stack resource before using it

FromJoerg Roedel <joro@8bytes.org>
Date2017-03-22 18:40 +0100
Subject[PATCH 1/3] ACPI, ioapic: Clear on-stack resource before using it
Message-ID<tnSoN-63J-13@gated-at.bofh.it>
From: Joerg Roedel <jroedel@suse.de>

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 pointers.

These pointers (in my case the ->child pointer) gets later
propagated to the global iomem_resources list, causing a #GP
exception when the list is traversed in
iomem_map_sanity_check().

Fixes: c183619b63ec ('x86/irq, ACPI: Implement ACPI driver to support IOAPIC hotplug')
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
 drivers/acpi/ioapic.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/acpi/ioapic.c b/drivers/acpi/ioapic.c
index 1120dfd6..7e4fbf9 100644
--- a/drivers/acpi/ioapic.c
+++ b/drivers/acpi/ioapic.c
@@ -45,6 +45,12 @@ static acpi_status setup_res(struct acpi_resource *acpi_res, void *data)
 	struct resource *res = data;
 	struct resource_win win;
 
+	/*
+	 * We might assign this to 'res' later, make sure all pointers are
+	 * cleared before the resource is added to the global list
+	 */
+	memset(&win, 0, sizeof(win));
+
 	res->flags = 0;
 	if (acpi_dev_filter_resource_type(acpi_res, IORESOURCE_MEM))
 		return AE_OK;
-- 
1.9.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web