Skip to content

Commit

Permalink
ARM: 7913/1: fix framepointer check in unwind_frame
Browse files Browse the repository at this point in the history
This patch fixes corner case when (fp + 4) overflows unsigned long,
for example: fp = 0xFFFFFFFF -> fp + 4 == 3.

Cc: <stable@vger.kernel.org>
Signed-off-by: Konstantin Khlebnikov <k.khlebnikov@samsung.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Konstantin Khlebnikov authored and Russell King committed Dec 9, 2013
1 parent 1b15ec7 commit 3abb667
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 @@ -31,7 +31,7 @@ int notrace unwind_frame(struct stackframe *frame)
high = ALIGN(low, THREAD_SIZE);

/* check current frame pointer is within bounds */
if (fp < (low + 12) || fp + 4 >= high)
if (fp < low + 12 || fp > high - 4)
return -EINVAL;

/* restore the registers from the stack frame */
Expand Down

0 comments on commit 3abb667

Please sign in to comment.