Skip to contentSkip to conversation

acpi: check for pxm_to_node_map overflow

PATCH New Cyrill Gorcunov 1 participant 1 message Feb 28, 2009 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 acpi: check for pxm_to_node_map overflow

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.

---

It's a patch resend. I didn't get any response on previous submission from Len, oh :(

Len is the patch really not needed or such a situation can't happen?

 drivers/acpi/numa.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/numa.c +1 -1
Index: linux-2.6.git/drivers/acpi/numa.c
===================================================================
@@ -277,7 +277,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;