Re: [PATCH] x86/ibt: make is_endbr() notrace
From: Menglong Dong
Date: Fri Sep 19 2025 - 04:59:03 EST
On 2025/9/19 16:52 Masami Hiramatsu <mhiramat@xxxxxxxxxx> write:
> On Thu, 18 Sep 2025 20:09:39 +0800
> Menglong Dong <menglong8.dong@xxxxxxxxx> wrote:
>
> > is_endbr() is called in __ftrace_return_to_handler -> fprobe_return ->
> > kprobe_multi_link_exit_handler -> is_endbr.
> >
> > It is not protected by the "bpf_prog_active", so it can't be traced by
> > kprobe-multi, which can cause recurring and panic the kernel. Fix it by
> > make it notrace.
>
> Ah, OK. This is fprobe's issue. fprobe depends on fgraph to check
> recursion, but fgraph only detects the recursion in the entry handler.
> Thus it happens in the exit handler, fprobe does not check the recursion.
>
> But since the fprobe provides users to register callback at exit, it
> should check the recursion in return path too.
That's a good idea to provide recursion checking for the exit handler,
which is able to solve this problem too.
If so, we don't need to check the recursion on the kprobe-multi anymore.
Do we?
Thanks!
Menglong Dong
>
> Thanks,
>
> --
> Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
>