Re: [PATCH] tracing/probes: fix race between probe execution and event unregistering
From: Antoine Tenart
Date: Wed Dec 02 2026 - 03:39:54 EST
On Tue, Dec 01, 2026 at 08:58:48AM -0500, Steven Rostedt wrote:
> On Tue, 1 Dec 2026 14:21:21 +0100
> Antoine Tenart <atenart@xxxxxxxxxx> wrote:
>
> > > @@ -2841,7 +2850,7 @@ int trace_probe_remove_file(struct trace_probe *tp,
> > > return -ENOENT;
> > >
> > > list_del_rcu(&link->list);
> > > - kvfree_rcu_mightsleep(link);
> > > + call_rcu(&link->rcu, free_link_rcu);
> >
> > While this defers freeing file, this unfortunately won't work because
> > this is not only about struct trace_event_file but also the pointers it
> > contains and the lifetime of those objects. E.g. accessing file->filter
> > will also cause UaF in trace_event_buffer_commit ->
> > __event_trigger_test_discard. (I haven't looked at the other pointers,
> > they might be problematic too).
>
> Then those need to be fixed as well.
All right. I was concerned about missing one, but I guess adding back a
costly call isn't an option. I'll cook a series and try not to miss a
path then.
Thanks!
Antoine