x86/kprobes: Push a fake return address at kretprobe_trampoline
authorMasami Hiramatsu <mhiramat@kernel.org>
Tue, 14 Sep 2021 14:42:22 +0000 (23:42 +0900)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 1 Oct 2021 01:24:07 +0000 (21:24 -0400)
commit1f36839308cf8d7d9d35586029f8ae4322e18ef5
treef28e70d7617147faaad89155589872b72d0f7bbe
parentdf91c5bccb0c2cb868b54bd68a6ddf1fcbede6b1
x86/kprobes: Push a fake return address at kretprobe_trampoline

Change __kretprobe_trampoline() to push the address of the
__kretprobe_trampoline() as a fake return address at the bottom
of the stack frame. This fake return address will be replaced
with the correct return address in the trampoline_handler().

With this change, the ORC unwinder can check whether the return
address is modified by kretprobes or not.

Link: https://lkml.kernel.org/r/163163054185.489837.14338744048957727386.stgit@devnote2
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Suggested-by: Josh Poimboeuf <jpoimboe@redhat.com>
Tested-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
arch/x86/kernel/kprobes/core.c