From: Masami Hiramatsu Date: Thu, 21 Oct 2021 00:55:00 +0000 (+0900) Subject: arm64: kprobes: Make a frame pointer on __kretprobe_trampoline X-Git-Tag: v6.6.17~8792^2~56 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fc6d647638a8412800dfd10ad687709cb4aee373;p=platform%2Fkernel%2Flinux-rpi.git arm64: kprobes: Make a frame pointer on __kretprobe_trampoline Make a frame pointer (make the x29 register points the address of pt_regs->regs[29]) on __kretprobe_trampoline. This frame pointer will be used by the stacktracer when it is called from the kretprobe handlers. In this case, the stack tracer will unwind stack to trampoline_probe_handler() and find the next frame pointer in the stack frame of the __kretprobe_trampoline(). Signed-off-by: Masami Hiramatsu Acked-by: Will Deacon Signed-off-by: Steven Rostedt (VMware) --- diff --git a/arch/arm64/kernel/probes/kprobes_trampoline.S b/arch/arm64/kernel/probes/kprobes_trampoline.S index 520ee87..9a6499b 100644 --- a/arch/arm64/kernel/probes/kprobes_trampoline.S +++ b/arch/arm64/kernel/probes/kprobes_trampoline.S @@ -66,6 +66,9 @@ SYM_CODE_START(__kretprobe_trampoline) save_all_base_regs + /* Setup a frame pointer. */ + add x29, sp, #S_FP + mov x0, sp bl trampoline_probe_handler /* @@ -74,6 +77,7 @@ SYM_CODE_START(__kretprobe_trampoline) */ mov lr, x0 + /* The frame pointer (x29) is restored with other registers. */ restore_all_base_regs add sp, sp, #PT_REGS_SIZE