[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-id: <200711010120.30410.yinghai.lu@sun.com>
Date: Thu, 01 Nov 2007 01:20:29 -0700
From: Yinghai Lu <Yinghai.Lu@....COM>
To: Andrew Morton <akpm@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...e.de>,
Gary Hade <gary.hade@...ibm.com>,
Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] x86: check boundary in count/setup_resource called by
get_current_resources
[PATCH] x86: check boundary in count/setup_resource called by get_current_resources
need to check info->res_num less than PCI_BUS_NUM_RESOURCES, so
info->bus->resource[info->res_num] = res will not beyond of bus resource array
when acpi resutrn too many resource entries.
Signed-off-by: Yinghai Lu <yinghai.lu@....com>
Index: linux-2.6/arch/x86/pci/acpi.c
===================================================================
--- linux-2.6.orig/arch/x86/pci/acpi.c
+++ linux-2.6/arch/x86/pci/acpi.c
@@ -77,9 +77,13 @@ count_resource(struct acpi_resource *acp
struct acpi_resource_address64 addr;
acpi_status status;
+ if (info->res_num >= PCI_BUS_NUM_RESOURCES)
+ return AE_OK;
+
status = resource_to_addr(acpi_res, &addr);
if (ACPI_SUCCESS(status))
info->res_num++;
+
return AE_OK;
}
@@ -93,6 +97,9 @@ setup_resource(struct acpi_resource *acp
unsigned long flags;
struct resource *root;
+ if (info->res_num >= PCI_BUS_NUM_RESOURCES)
+ return AE_OK;
+
status = resource_to_addr(acpi_res, &addr);
if (!ACPI_SUCCESS(status))
return AE_OK;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists