From: sashiko-bot@kernel.org
To: "Danish Khateeb" <danishkhateeb03@gmail.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v3] perf/core: Don't send SIGTRAP after exec removed the event
Date: Thu, 15 Oct 2026 15:31:16 +0000 [thread overview]
Message-ID: <sashiko-outbox-173075@kernel.org> (raw)
In-Reply-To: <20261015152013.106040-1-danishkhateeb03@gmail.com>
> A sigtrap event must also set remove_on_exec, so that its SIGTRAP never
> reaches a program after exec. But the signal is sent from task work,
> which only runs on the way back to user space. If the event overflows
> shortly before execve(), the task work can still be pending when the
> task enters execve(), and then runs when execve() returns. By then
> perf_event_exec() has removed the event and the new program has default
> signal handlers, so the SIGTRAP kills it.
>
> The exec_stress test in the remove_on_exec selftest catches this and
> fails about half the time in a VM. A process that opens a sigtrap event
> on itself and then calls execve() is killed by SIGTRAP in 15% to 50% of
> runs, both on an AMD machine running v7.2 and in a VM, with or without
> close-on-exec on the event fd.
>
> Commit ffb684f2aa14 ("perf: Fix race between perf_event_exit_task() and
> [ ... ]
>
> Fixes: 97ba62b27867 ("perf: Add support for SIGTRAP on perf events")
> Cc: stable@vger.kernel.org
> Assisted-by: LLM
> Signed-off-by: Danish Khateeb <danishkhateeb03@gmail.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261015152013.106040-1-danishkhateeb03@gmail.com?part=1
prev parent reply other threads:[~2026-10-15 15:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 15:20 [PATCH v3] perf/core: Don't send SIGTRAP after exec removed the event Danish Khateeb
2026-10-15 15:31 ` sashiko-bot [this message]
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-173075@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=danishkhateeb03@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox