arm64: when walking onto the task stack, check sp & fp are in current->stack
authorJames Morse <james.morse@arm.com>
Thu, 10 Dec 2015 10:22:40 +0000 (10:22 +0000)
committerAlex Shi <alex.shi@linaro.org>
Wed, 11 May 2016 07:57:01 +0000 (15:57 +0800)
commite330d15430acce6073bb2c8486fba7555be1e923
tree531afef01cbfb014a5c79665de509261e28e7b6a
parent95e1db8bd78d2b3f15f7d4e7896735a041c775f6
arm64: when walking onto the task stack, check sp & fp are in current->stack

When unwind_frame() reaches the bottom of the irq_stack, the last fp
points to the original task stack. unwind_frame() uses
IRQ_STACK_TO_TASK_STACK() to find the sp value. If either values is
wrong, we may end up walking a corrupt stack.

Check these values are sane by testing if they are both on the stack
pointed to by current->stack.

Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit 1ffe199b1c9b72a8e752a9ae2a7af10128ab2ca1)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
arch/arm64/kernel/stacktrace.c