Re: [PATCH v2 12/39] x86/ibt,ftrace: Search for __fentry__ location

From: Steven Rostedt
Date: Wed Mar 02 2022 - 15:48:18 EST


On Wed, 2 Mar 2022 14:47:16 -0500
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> Note, I just pulled this patch, and I hit this warning:
>
> WARNING: CPU: 0 PID: 6965 at arch/x86/kernel/kprobes/core.c:205 recover_probed_instruction+0x8f/0xa0

As we discussed on IRC (but I want an email record of this), it appears that
with some debugging, the ftrace_location() could return the function right
after the current function because lookup_rec() has an inclusive "end"
argument.

Testing:

rec = lookup_rec(ip - offset, (ip - offset) + size - 1);

Appears to fix the issue.

-- Steve