[PATCH] riscv: Fix ftrace_graph_ret_addr() to use the correct task pointer

Paul Walmsley pjw at kernel.org
Wed May 13 19:15:24 PDT 2026


On Wed, 8 Apr 2026, Rui Qi wrote:

> The walk_stackframe() function is used to unwind the stack of a given
> task. When function graph tracing is enabled, ftrace_graph_ret_addr()
> is called to resolve the original return address if it was modified by
> the tracer.
> 
> The current code incorrectly passes 'current' instead of 'task' to
> ftrace_graph_ret_addr(). This causes incorrect return address resolution
> when unwinding a stack of a different task (e.g., when the task is
> blocked in __switch_to).
> 
> Fix this by passing 'task' instead of 'current' to match the behavior
> of other architectures (arm64, loongarch, powerpc, s390, x86).
> 
> Signed-off-by: Rui Qi <qirui.001 at bytedance.com>

Thanks, queued for v7.1-rc.


- Paul



More information about the linux-riscv mailing list