From: sashiko-bot@kernel.org
To: "Tengda Wu" <wutengda@huaweicloud.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v4 1/2] perf/core: Prevent duplicate sigtrap task work enqueue
Date: Tue, 17 Nov 2026 11:47:56 +0000 [thread overview]
Message-ID: <sashiko-outbox-218727@kernel.org> (raw)
In-Reply-To: <45bd71c976aea1a0e8bf5762dd6b6552e6009439.1794914794.git.wutengda@huaweicloud.com>
> The sigtrap handling in __perf_event_overflow() checks
> event->pending_work before calling task_work_add(), but only sets
> pending_work after the task work has been queued.
>
> This leaves a window where an NMI can interrupt task_work_add()
> and re-enter __perf_event_overflow() for the same event. Since
> pending_work is still zero, the nested invocation can enqueue
> the same pending_task again.
>
> The re-entrant call path looks like this:
>
> __perf_event_overflow()
> task_work_add()
> kasan_record_aux_stack()
> <NMI>
> [ ... ]
> the exclude_kernel warning path to ensure the read is properly
> ordered.
>
> Fixes: c5d93d23a260 ("perf: Enqueue SIGTRAP always via task_work.")
> Signed-off-by: Tengda Wu <wutengda@huaweicloud.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1794914794.git.wutengda@huaweicloud.com?part=1
next prev parent reply other threads:[~2026-11-17 11:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 11:28 [PATCH v4 0/2] perf/core: Fix sigtrap task_work races Tengda Wu
2026-11-17 11:28 ` [PATCH v4 1/2] perf/core: Prevent duplicate sigtrap task work enqueue Tengda Wu
2026-11-17 11:47 ` sashiko-bot [this message]
2026-11-17 11:28 ` [PATCH v4 2/2] perf/core: Disable context fast-swap for sigtrap events Tengda Wu
2026-11-17 11:53 ` sashiko-bot
2026-11-18 2:52 ` Tengda Wu
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-218727@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=wutengda@huaweicloud.com \
/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.