[PATCH v2] arm64: ftrace: use HAVE_FUNCTION_GRAPH_RET_ADDR_PTR

Mark Rutland mark.rutland at arm.com
Mon Nov 15 06:46:31 PST 2021


Hi Will,

On Wed, Nov 03, 2021 at 01:19:45PM +0000, Will Deacon wrote:
> On Fri, 29 Oct 2021 17:22:45 +0100, Mark Rutland wrote:
> > When CONFIG_FUNCTION_GRAPH_TRACER is selected and the function graph
> > tracer is in use, unwind_frame() may erroneously associate a traced
> > function with an incorrect return address. This can happen when starting
> > an unwind from a pt_regs, or when unwinding across an exception
> > boundary.
> > 
> > This can be seen when recording with perf while the function graph
> > tracer is in use. For example:
> > 
> > [...]
> 
> Applied to arm64 (for-next/core), thanks!
> 
> [1/1] arm64: ftrace: use HAVE_FUNCTION_GRAPH_RET_ADDR_PTR
>       https://git.kernel.org/arm64/c/552e196d88e5

After this got applied, it got dropped due to a couple of (relatively
trivial) conflicts with:

  cd9bc2c9258816dc ("arm64: Recover kretprobe modified return address in stacktrace")
  
... since that was going via the ftrace tree.

Now that's in v5.16-rc1, are you happy to pick this as a fix for
v5.16-rc2?

I've push a version rebased atop v5.16-rc1 to:

  https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/log/?h=arm64/stacktrace/arch-stack-walk
  git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git arm64/stacktrace/arch-stack-walk

... which I've re-tested as per the existig description in the commit
message.

If you'd like, I can send that out as a v3 so you have something to
refer to in a link tag. Otherwise, if you'd prefer to fix that up
yourself the resolution is pretty straightforward: delete the lines
using stackframe::graph.

Thanks,
Mark.



More information about the linux-arm-kernel mailing list