From: Russell King Date: Sat, 26 May 2007 11:04:17 +0000 (+0100) Subject: [ARM] Fix stacktrace FP range checking X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5b10c8e436b69f25b6dcb5586bbdc5e39c20ed1d;p=linux-beck.git [ARM] Fix stacktrace FP range checking Fix an oops in the stacktrace code, caused by improper range checking. We subtract 12 off 'fp' before testing to see if it's below the low bound. However, if 'fp' were zero before, it becomes a very large positive number, causing this test to succeed where it should fail. Signed-off-by: Russell King --- diff --git a/arch/arm/kernel/stacktrace.c b/arch/arm/kernel/stacktrace.c index 8b63ad89d0a8..ae31deb2d065 100644 --- a/arch/arm/kernel/stacktrace.c +++ b/arch/arm/kernel/stacktrace.c @@ -13,7 +13,7 @@ int walk_stackframe(unsigned long fp, unsigned long low, unsigned long high, /* * Check current frame pointer is within bounds */ - if ((fp - 12) < low || fp + 4 >= high) + if (fp < (low + 12) || fp + 4 >= high) break; frame = (struct stackframe *)(fp - 12);