Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Luo Gengkun" <luogengkun2@huawei.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v2] perf/core: Fix race between perf_event_exit_task() and perf_pending_task()
Date: Sun, 20 Sep 2026 07:32:19 +0000	[thread overview]
Message-ID: <20260920073219.E95E81F0089A@smtp.kernel.org> (raw)
In-Reply-To: <20260920075026.990582-1-luogengkun2@huawei.com>

> A race condition exists between perf_event_exit_task() and
> perf_pending_task() during begin_new_exec().
> 
> During begin_new_exec(), perf_event_exit_task() may be called, and the
> PF_EXITING flag is not set on task. So perf_sigtrap() continues to execute
> and triggers WARN_ON_ONCE(event->ctx->task != current).
> 
> Since both task exit and exec paths can call perf_event_exit_task() which
> sets ctx->task to TASK_TOMBSTONE, fix this by explicitly checking if
> event->ctx->task equals TASK_TOMBSTONE and dropping the redundant
> PF_EXITING check.
> 
> Fixes: 97ba62b27867 ("perf: Add support for SIGTRAP on perf events")
> Signed-off-by: Luo Gengkun <luogengkun2@huawei.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260920075026.990582-1-luogengkun2@huawei.com?part=1


      reply	other threads:[~2026-09-20  7:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-16  3:34 [PATCH] perf/core: Fix race between perf_event_exit_task and perf_pending_task Luo Gengkun
2026-09-15 21:34 ` Ian Rogers
2026-09-18  9:02   ` Dmitry Vyukov
2026-09-18  9:50 ` Peter Zijlstra
2026-09-20  7:50   ` [PATCH v2] perf/core: Fix race between perf_event_exit_task() and perf_pending_task() Luo Gengkun
2026-09-20  7:32     ` 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=20260920073219.E95E81F0089A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=luogengkun2@huawei.com \
    --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