From: sashiko-bot@kernel.org
To: "Daniel Wade" <danjwade95@gmail.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v2] perf: Reject group leaders detached by CPU hot-unplug
Date: Thu, 19 Nov 2026 01:55:18 +0000 [thread overview]
Message-ID: <sashiko-outbox-222306@kernel.org> (raw)
In-Reply-To: <20261119014730.2074-1-danjwade95@gmail.com>
> CPU hot-unplug detaches the events of a CPU context but leaves them in
> OFF or ERROR, so once the CPU is back a detached leader is still accepted
> as group_fd. perf_group_detach() does nothing for a leader that is
> already detached, so closing it frees it with the new sibling still
> linked, and closing the sibling is a use-after-free.
>
> Detach them with DETACH_EXIT as well, so that they end up in
> PERF_EVENT_STATE_EXIT and are rejected by the check from
> commit fa091f46c383 ("perf: Reject exited events as group leaders").
>
> Side effect: poll() on a hot-unplugged event now reports EPOLLHUP, and it
> is refused as group_fd even with PERF_FLAG_FD_NO_GROUP.
>
> Fixes: 226424eee809 ("perf: Fix corruption of sibling list with hotplug")
> Suggested-by: Peter Zijlstra <peterz@infradead.org>
> Signed-off-by: Daniel Wade <danjwade95@gmail.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261119014730.2074-1-danjwade95@gmail.com?part=1
next prev parent reply other threads:[~2026-11-19 1:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 1:47 [PATCH v2] perf: Reject group leaders detached by CPU hot-unplug Daniel Wade
2026-11-19 1:55 ` sashiko-bot [this message]
2026-11-19 8:54 ` Aditya Chillara
2026-11-19 9:19 ` Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-222306@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=danjwade95@gmail.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.