]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: 8992/1: Fix unwind_frame for clang-built kernels
authorNathan Huckleberry <nhuck@google.com>
Fri, 10 Jul 2020 19:23:37 +0000 (20:23 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Tue, 21 Jul 2020 15:33:40 +0000 (16:33 +0100)
commitd94bffb160f90a34a7bc8fc3e3ec34ae6172f300
tree9636d4f12db602048a3768d27025c8af64115da0
parent0c90a2b0ba588540c55797b81f19a47423afc270
ARM: 8992/1: Fix unwind_frame for clang-built kernels

Since clang does not push pc and sp in function prologues, the current
implementation of unwind_frame does not work. By using the previous
frame's lr/fp instead of saved pc/sp we get valid unwinds on clang-built
kernels.

The bounds check on next frame pointer must be changed as well since
there are 8 less bytes between frames.

This fixes /proc/<pid>/stack.

Link: https://github.com/ClangBuiltLinux/linux/issues/912
Reported-by: Miles Chen <miles.chen@mediatek.com>
Tested-by: Miles Chen <miles.chen@mediatek.com>
Cc: stable@vger.kernel.org
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Huckleberry <nhuck@google.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
arch/arm/kernel/stacktrace.c