aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2014-08-29 16:11:10 +0100
committerMark Brown <broonie@kernel.org>2015-01-22 21:27:29 +0000
commitb9725baa1ec2a8827096d3941a38c887cd07ffd9 (patch)
treec5a775fa863f9346c696c75a2ef72607f31496e4
parentadf5da773504328b2520ecf63f2098eaef982349 (diff)
downloadlinux-linaro-stable-b9725baa1ec2a8827096d3941a38c887cd07ffd9.tar.gz
arm64: report correct stack pointer in KSTK_ESP for compat tasks
The KSTK_ESP macro is used to determine the user stack pointer for a given task. In particular, this is used to to report the '[stack]' VMA in /proc/self/maps, which is used by Android to determine the stack location for children of the main thread. This patch fixes the macro to use user_stack_pointer instead of directly returning sp. This means that we report w13 instead of sp, since the former is used as the stack pointer when executing in AArch32 state. Cc: <stable@vger.kernel.org> Reported-by: Serban Constantinescu <Serban.Constantinescu@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> (cherry picked from commit 3168a743461ecf86adf3e7dcfcd79271828fb263) Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--arch/arm64/include/asm/processor.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h
index db3112886968..3b7bb031f98f 100644
--- a/arch/arm64/include/asm/processor.h
+++ b/arch/arm64/include/asm/processor.h
@@ -132,7 +132,7 @@ extern struct task_struct *cpu_switch_to(struct task_struct *prev,
((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1)
#define KSTK_EIP(tsk) ((unsigned long)task_pt_regs(tsk)->pc)
-#define KSTK_ESP(tsk) ((unsigned long)task_pt_regs(tsk)->sp)
+#define KSTK_ESP(tsk) user_stack_pointer(task_pt_regs(tsk))
/*
* Prefetching support