summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-08-06 16:00:37 -0700
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-08-20 10:27:12 +1000
commit8dcd038a13b8e322c49fe0d3e31a0deaba4fd5fd (patch)
tree657cb5c3ef0da7de481ebd2c3297f68653e5d410 /arch/powerpc/mm
parentb6c316a1f6447d6dd0fd8d443b66643e328e04fa (diff)
downloadop-kernel-dev-8dcd038a13b8e322c49fe0d3e31a0deaba4fd5fd.zip
op-kernel-dev-8dcd038a13b8e322c49fe0d3e31a0deaba4fd5fd.tar.gz
powerpc/fsl-booke: read buffer overflow
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>
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r--arch/powerpc/mm/fsl_booke_mmu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/mm/fsl_booke_mmu.c b/arch/powerpc/mm/fsl_booke_mmu.c
index bb3d659..dc93e95 100644
--- a/arch/powerpc/mm/fsl_booke_mmu.c
+++ b/arch/powerpc/mm/fsl_booke_mmu.c
@@ -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];
OpenPOWER on IntegriCloud