]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
powerpc/fsl-booke: read buffer overflow
authorRoel Kluin <roel.kluin@gmail.com>
Thu, 6 Aug 2009 23:00:37 +0000 (16:00 -0700)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 20 Aug 2009 00:27:12 +0000 (10:27 +1000)
cam[tlbcam_index] is checked before tlbcam_index < ARRAY_SIZE(cam)

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/mm/fsl_booke_mmu.c

index bb3d65998e6b514028d8c3af7b6c9c036047ba0d..dc93e95b256eae04e248900e82858d94c8fe822a 100644 (file)
@@ -161,7 +161,7 @@ unsigned long __init mmu_mapin_ram(void)
        unsigned long virt = PAGE_OFFSET;
        phys_addr_t phys = memstart_addr;
 
-       while (cam[tlbcam_index] && tlbcam_index < ARRAY_SIZE(cam)) {
+       while (tlbcam_index < ARRAY_SIZE(cam) && cam[tlbcam_index]) {
                settlbcam(tlbcam_index, virt, phys, cam[tlbcam_index], PAGE_KERNEL_X, 0);
                virt += cam[tlbcam_index];
                phys += cam[tlbcam_index];