]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: Recover kretprobe modified return address in stacktrace
authorMasami Hiramatsu <mhiramat@kernel.org>
Thu, 21 Oct 2021 00:55:35 +0000 (09:55 +0900)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 22 Oct 2021 16:16:53 +0000 (12:16 -0400)
commit77b5afa09b586edf94a1a72d34dc6cf332b94397
tree332b5002123a3db9bd9b6bc9a5f0144f008374eb
parentdab29f2ab3fe440732dfc709efb4322f66a8ab32
ARM: Recover kretprobe modified return address in stacktrace

Since the kretprobe replaces the function return address with
the kretprobe_trampoline on the stack, arm unwinder shows it
instead of the correct return address.

This finds the correct return address from the per-task
kretprobe_instances list and verify it is in between the
caller fp and callee fp.

Note that this supports both GCC and clang if CONFIG_FRAME_POINTER=y
and CONFIG_ARM_UNWIND=n. For the ARM unwinder, this is still
not working correctly.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
arch/arm/Kconfig
arch/arm/include/asm/stacktrace.h
arch/arm/kernel/return_address.c
arch/arm/kernel/stacktrace.c