diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2019-01-02 01:08:32 -0800 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2019-02-07 12:34:02 -0800 |
commit | d90b88fd3653f1fb66ecc6571b860d5a5749fa56 (patch) | |
tree | 97ff4ed6e1be83b1334ea8624d81306537b7aef7 /arch/xtensa/kernel | |
parent | 579afe866f52adcd921272a224ab36733051059c (diff) | |
download | linux-stable-d90b88fd3653f1fb66ecc6571b860d5a5749fa56.tar.gz linux-stable-d90b88fd3653f1fb66ecc6571b860d5a5749fa56.tar.bz2 linux-stable-d90b88fd3653f1fb66ecc6571b860d5a5749fa56.zip |
xtensa: fix get_wchan
Stack unwinding is implemented incorrectly in xtensa get_wchan: instead
of extracting a0 and a1 registers from the spill location under the
stack pointer it extracts a word pointed to by the stack pointer and
subtracts 4 or 3 from it.
Cc: stable@vger.kernel.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/kernel')
-rw-r--r-- | arch/xtensa/kernel/process.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/xtensa/kernel/process.c b/arch/xtensa/kernel/process.c index 74969a437a37..2e73395f0560 100644 --- a/arch/xtensa/kernel/process.c +++ b/arch/xtensa/kernel/process.c @@ -321,8 +321,8 @@ unsigned long get_wchan(struct task_struct *p) /* Stack layout: sp-4: ra, sp-3: sp' */ - pc = MAKE_PC_FROM_RA(*(unsigned long*)sp - 4, sp); - sp = *(unsigned long *)sp - 3; + pc = MAKE_PC_FROM_RA(SPILL_SLOT(sp, 0), sp); + sp = SPILL_SLOT(sp, 1); } while (count++ < 16); return 0; } |