[patch 2/3] powerpc/fsl-booke: read buffer overflow

STALE6243d

2 messages, 2 authors, 2009-08-07 · open the first message on its own page

[patch 2/3] powerpc/fsl-booke: read buffer overflow

From: akpm@linux-foundation.org
Date: 2009-08-06 23:00:44

From: Roel Kluin <redacted>

cam[tlbcam_index] is checked before tlbcam_index < ARRAY_SIZE(cam)

Signed-off-by: Roel Kluin <redacted>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/powerpc/mm/fsl_booke_mmu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN arch/powerpc/mm/fsl_booke_mmu.c~powerpc-fsl-booke-read-buffer-overflow arch/powerpc/mm/fsl_booke_mmu.c
--- a/arch/powerpc/mm/fsl_booke_mmu.c~powerpc-fsl-booke-read-buffer-overflow
+++ a/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];
_

Re: [patch 2/3] powerpc/fsl-booke: read buffer overflow

From: Kumar Gala <hidden>
Date: 2009-08-07 02:27:18

On Aug 6, 2009, at 6:00 PM, akpm@linux-foundation.org wrote:
From: Roel Kluin <redacted>

cam[tlbcam_index] is checked before tlbcam_index < ARRAY_SIZE(cam)

Signed-off-by: Roel Kluin <redacted>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

arch/powerpc/mm/fsl_booke_mmu.c |    2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

applied to next

- k
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help