[patch 3/3] acpi: check for pxm_to_node_map overflow

From: Cyrill Gorcunov
Date: Fri Jan 02 2009 - 03:34:51 EST


It is hardly (if ever) possible but in case of broken _PXM
entry we could reach out of pxm_to_node_map array
bounds in acpi_map_pxm_to_node() call. Lets check it
(it's not that expensive and safe).

Signed-off-by: Cyrill Gorcunov <gorcunov@xxxxxxxxxx>
CC: Len Brown <lenb@xxxxxxxxxx>
---
drivers/acpi/numa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.git/drivers/acpi/numa.c
===================================================================
--- linux-2.6.git.orig/drivers/acpi/numa.c
+++ linux-2.6.git/drivers/acpi/numa.c
@@ -278,7 +278,7 @@ int acpi_get_node(acpi_handle *handle)
int pxm, node = -1;

pxm = acpi_get_pxm(handle);
- if (pxm >= 0)
+ if (pxm >= 0 && pxm < MAX_PXM_DOMAINS)
node = acpi_map_pxm_to_node(pxm);

return node;

--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/