Re: [PATCH bpf-next 5/6] bpf: Improve tracing recursion prevention mechanism

From: Steven Rostedt
Date: Thu Apr 27 2023 - 11:46:53 EST


On Thu, 27 Apr 2023 23:43:35 +0800
Yafang Shao <laoar.shao@xxxxxxxxx> wrote:

> > > I thought that the whole point of this exercise was because the
> > > migrate_disable() itself could be traced (or call something that can), and
> > > that's outside of prog->active protection. Which the test_recursion_*()
> > > code was created for.
> >
> > Not sure where did this come from.
> > migrate_enable/disable were added to deny list back in 2021.
>
> Hi Alexei,
>
> Don't be uneasy. It is not good to play word games.
> What Steven really meant is the preempt_count_{sub, add}.
> Anyway thanks Steven for the help with this exercise.

Right, it was the "(or call something that can)" part that this came from.
As Yafang said, migrate_disable() calls preempt_count_add() (on some
configs) which is traced by ftrace, and thus traced by bpf. Or was that
added to the deny list? I think that was one of the solutions as well.

-- Steve