Skip to content

Commit

Permalink
[ARM] Fix stacktrace FP range checking
Browse files Browse the repository at this point in the history
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 <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King authored and Russell King committed May 30, 2007
1 parent b91d8a1 commit 5b10c8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/kernel/stacktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5b10c8e

Please sign in to comment.