]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ia64: prevent buffer-overrun in acpi_numa_memory_affinity_init()
authorJack Steiner <steiner@sgi.com>
Fri, 19 Dec 2003 07:09:49 +0000 (23:09 -0800)
committerDavid Mosberger <davidm@tiger.hpl.hp.com>
Fri, 19 Dec 2003 07:09:49 +0000 (23:09 -0800)
The code in acpi_numa_memory_affinity_init that sorts the node_memblk
can overrun the array & clobber the memory that follows the end of the
array. The error will be seen only on systems that fill the
node_memblk array and only if SAL doesnt sort the entries in the SRAT.

arch/ia64/kernel/acpi.c

index d757134a2175e2a100dbadf29fdbfeaf0b59e1aa..805d4f22f51a6db572bc1d3a3a8d4a79130d3b43 100644 (file)
@@ -413,7 +413,7 @@ acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma)
                        break;
        }
        if (p < pend) {
-               for (q = pend; q >= p; q--)
+               for (q = pend - 1; q >= p; q--)
                        *(q + 1) = *q;
        }
        p->start_paddr = paddr;