]> Git Repo - linux.git/commit
arm64: Recover kretprobe modified return address in stacktrace
authorMasami Hiramatsu <[email protected]>
Thu, 21 Oct 2021 00:55:09 +0000 (09:55 +0900)
committerSteven Rostedt (VMware) <[email protected]>
Fri, 22 Oct 2021 16:16:53 +0000 (12:16 -0400)
commitcd9bc2c9258816dc934b300705076519d7375b81
tree3be8beecf0c48ccece7a6f36a2c10ca19117753a
parentfc6d647638a8412800dfd10ad687709cb4aee373
arm64: Recover kretprobe modified return address in stacktrace

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

This checks whether the next return address is the
__kretprobe_trampoline(), and if so, try to find the correct
return address from the kretprobe instance list. For this purpose
this adds 'kr_cur' loop cursor to memorize the current kretprobe
instance.

With this fix, now arm64 can enable
CONFIG_ARCH_CORRECT_STACKTRACE_ON_KRETPROBE, and pass the
kprobe self tests.

Signed-off-by: Masami Hiramatsu <[email protected]>
Acked-by: Will Deacon <[email protected]>
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
arch/arm64/Kconfig
arch/arm64/include/asm/stacktrace.h
arch/arm64/kernel/stacktrace.c
This page took 0.058126 seconds and 4 git commands to generate.