ARM: 7913/1: fix framepointer check in unwind_frame
commit 3abb6671a9c04479c4bd026798a05f857393b7e2 upstream. This patch fixes corner case when (fp + 4) overflows unsigned long, for example: fp = 0xFFFFFFFF -> fp + 4 == 3. Signed-off-by: Konstantin Khlebnikov <k.khlebnikov@samsung.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
fa2ea62aeb
commit
47131c7c78
|
@ -31,7 +31,7 @@ int notrace unwind_frame(struct stackframe *frame)
|
||||||
high = ALIGN(low, THREAD_SIZE);
|
high = ALIGN(low, THREAD_SIZE);
|
||||||
|
|
||||||
/* check current frame pointer is within bounds */
|
/* check current frame pointer is within bounds */
|
||||||
if (fp < (low + 12) || fp + 4 >= high)
|
if (fp < low + 12 || fp > high - 4)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
/* restore the registers from the stack frame */
|
/* restore the registers from the stack frame */
|
||||||
|
|
Loading…
Reference in New Issue