Skip to content

Commit 0a197b7

Browse files
committed
Merge tag 'perf_urgent_for_v6.16_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fix from Borislav Petkov: - Prevent perf_sigtrap() from observing an exiting task and warning about it * tag 'perf_urgent_for_v6.16_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/core: Fix WARN in perf_sigtrap()
2 parents 3f31a80 + 3da6bb4 commit 0a197b7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

kernel/events/core.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7204,18 +7204,18 @@ void perf_event_wakeup(struct perf_event *event)
72047204
static void perf_sigtrap(struct perf_event *event)
72057205
{
72067206
/*
7207-
* We'd expect this to only occur if the irq_work is delayed and either
7208-
* ctx->task or current has changed in the meantime. This can be the
7209-
* case on architectures that do not implement arch_irq_work_raise().
7207+
* Both perf_pending_task() and perf_pending_irq() can race with the
7208+
* task exiting.
72107209
*/
7211-
if (WARN_ON_ONCE(event->ctx->task != current))
7210+
if (current->flags & PF_EXITING)
72127211
return;
72137212

72147213
/*
7215-
* Both perf_pending_task() and perf_pending_irq() can race with the
7216-
* task exiting.
7214+
* We'd expect this to only occur if the irq_work is delayed and either
7215+
* ctx->task or current has changed in the meantime. This can be the
7216+
* case on architectures that do not implement arch_irq_work_raise().
72177217
*/
7218-
if (current->flags & PF_EXITING)
7218+
if (WARN_ON_ONCE(event->ctx->task != current))
72197219
return;
72207220

72217221
send_sig_perf((void __user *)event->pending_addr,

0 commit comments

Comments
 (0)