Re: [PATCH 2/4] perf: Fix irq work dereferencing garbage

From: Frederic Weisbecker
Date: Fri May 02 2025 - 08:05:15 EST


Le Fri, May 02, 2025 at 01:30:02PM +0200, Peter Zijlstra a écrit :
> On Fri, May 02, 2025 at 12:29:18PM +0200, Peter Zijlstra wrote:
>
> > > @@ -13951,18 +13943,25 @@ perf_event_exit_event(struct perf_event *event,
> > > /*
> > > * Child events can be freed.
> > > */
> > > - if (is_child) {
> > > - if (parent_event) {
> > > - mutex_unlock(&parent_event->child_mutex);
> > > - /*
> > > - * Kick perf_poll() for is_event_hup();
> > > - */
> > > - perf_event_wakeup(parent_event);
> > > + if (parent_event) {
> > > + mutex_unlock(&parent_event->child_mutex);
> > > + /*
> > > + * Kick perf_poll() for is_event_hup();
> > > + */
> > > + perf_event_wakeup(parent_event);
> >
> > Should not this perf_event_wakeup() be inside the next if() as well?
> > doing anything on parent_event when !ATTACH_CHILD seems dodgy.
>
> I made this change, and munged the original changelog on top and stuffed
> the patches into queue/perf/core.

Looks good, but it looks like you trimmed the changelog with the
race windows part. Though I must confess, who wants to read that anyway? ;-)

--
Frederic Weisbecker
SUSE Labs