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)
commitfed240d9c9743815fcbc0ca5c0913292ce1f25e2
tree332b5002123a3db9bd9b6bc9a5f0144f008374eb
parent7e9bf33b812471ee57a03ec7f9b544ca437cc706
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