This is a note to let you know that I've just added the patch titled riscv: stacktrace: Fixup ftrace_graph_ret_addr retp argument to the 4.19-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: riscv-stacktrace-fixup-ftrace_graph_ret_addr-retp-ar.patch and it can be found in the queue-4.19 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 72dea6c020220e8f4916d698293730b8f3dc8b27 Author: Guo Ren <guoren@xxxxxxxxxx> Date: Wed Nov 9 01:49:36 2022 -0500 riscv: stacktrace: Fixup ftrace_graph_ret_addr retp argument [ Upstream commit 5c3022e4a616d800cf5f4c3a981d7992179e44a1 ] The 'retp' is a pointer to the return address on the stack, so we must pass the current return address pointer as the 'retp' argument to ftrace_push_return_trace(). Not parent function's return address on the stack. Fixes: b785ec129bd9 ("riscv/ftrace: Add HAVE_FUNCTION_GRAPH_RET_ADDR_PTR support") Signed-off-by: Guo Ren <guoren@xxxxxxxxxxxxxxxxx> Signed-off-by: Guo Ren <guoren@xxxxxxxxxx> Link: https://lore.kernel.org/r/20221109064937.3643993-2-guoren@xxxxxxxxxx Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Palmer Dabbelt <palmer@xxxxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/arch/riscv/kernel/stacktrace.c b/arch/riscv/kernel/stacktrace.c index 3d1e184e39e9..75ed5b5b1f9b 100644 --- a/arch/riscv/kernel/stacktrace.c +++ b/arch/riscv/kernel/stacktrace.c @@ -69,7 +69,7 @@ static void notrace walk_stackframe(struct task_struct *task, } else { fp = frame->fp; pc = ftrace_graph_ret_addr(current, NULL, frame->ra, - (unsigned long *)(fp - 8)); + &frame->ra); } }