s390/unwind: Fix fgraph return address recovery
Subsystems (2)
PATCH 1/1 s390/unwind: Fix fgraph return address recovery
When HAVE_FUNCTION_GRAPH_RET_ADDR_PTR is defined, the return address to the fgraph caller is recovered by tagging it along with the stack pointer of ftrace stack. This makes the stack unwinding more reliable.
When the fgraph return address is modified to return_to_handler, ftrace_graph_ret_addr tries to restore it to the original value using tagged stack pointer.
Fix this by passing tagged sp to ftrace_graph_ret_addr.
Fixes d81675b60d09 ("s390/unwind: recover kretprobe modified return address in stacktrace")
Cc <[email protected]> # 5.18
Signed-off-by Sumanth Korikkar <[email protected]>
--- arch/s390/include/asm/unwind.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/include/asm/unwind.h +1 -1
@@ -47,7 +47,7 @@ struct unwind_state {static inline unsigned long unwind_recover_ret_addr (struct unwind_state *state,unsigned long ip) { - ip =ftrace_graph_ret_addr (state->task, &state->graph_idx, ip,NULL ); + ip =ftrace_graph_ret_addr (state->task, &state->graph_idx, ip, (void *)state->sp);if (is_kretprobe_trampoline (ip)) ip =kretprobe_find_ret_addr (state->task, (void *)state->sp, &state->kr_cur);return ip;
Signature · 1 line
2.36.1