aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/kernel/acpi.c
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2011-01-07 12:11:55 -0500
committerTony Luck <tony.luck@intel.com>2011-01-07 12:11:55 -0500
commit05f2f274c8a8747bbfb13ac8ee0c27d5f2ad8510 (patch)
tree26626f1f78d12fbe179bfeb9b7c1fecdac1d8c93 /arch/ia64/kernel/acpi.c
parente7d282535c94cddc208c03b7cd0815f70d676a0e (diff)
[IA64] Avoid array overflow if there are too many cpus in SRAT table
acpi_numa_init() has to parse the whole SRAT table, even if the kernel wants to limit the number of cpus it will use (because the ones it is going to use may be described by entries at the end of the SRAT table). Avoid overflowing the node_cpuid array. Reported-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/kernel/acpi.c')
-rw-r--r--arch/ia64/kernel/acpi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index c6c90f39f4d9..7b897b7b0ae6 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -477,6 +477,12 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
477 if (!(pa->flags & ACPI_SRAT_CPU_ENABLED)) 477 if (!(pa->flags & ACPI_SRAT_CPU_ENABLED))
478 return; 478 return;
479 479
480 if (srat_num_cpus >= ARRAY_SIZE(node_cpuid)) {
481 printk_once(KERN_WARNING
482 "node_cpuid[%d] is too small, may not be able to use all cpus\n",
483 ARRAY_SIZE(node_cpuid));
484 return;
485 }
480 pxm = get_processor_proximity_domain(pa); 486 pxm = get_processor_proximity_domain(pa);
481 487
482 /* record this node in proximity bitmap */ 488 /* record this node in proximity bitmap */