Преглед изворни кода

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.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
Cyrill Gorcunov пре 16 година
родитељ
комит
27ce341983
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      drivers/acpi/numa.c

+ 1 - 1
drivers/acpi/numa.c

@@ -277,7 +277,7 @@ int acpi_get_node(acpi_handle *handle)
 	int pxm, node = -1;
 	int pxm, node = -1;
 
 
 	pxm = acpi_get_pxm(handle);
 	pxm = acpi_get_pxm(handle);
-	if (pxm >= 0)
+	if (pxm >= 0 && pxm < MAX_PXM_DOMAINS)
 		node = acpi_map_pxm_to_node(pxm);
 		node = acpi_map_pxm_to_node(pxm);
 
 
 	return node;
 	return node;