Commit 0a197b75 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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()
parents 3f31a806 3da6bb41
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -7204,18 +7204,18 @@ void perf_event_wakeup(struct perf_event *event)
static void perf_sigtrap(struct perf_event *event)
{
	/*
	 * We'd expect this to only occur if the irq_work is delayed and either
	 * ctx->task or current has changed in the meantime. This can be the
	 * case on architectures that do not implement arch_irq_work_raise().
	 * Both perf_pending_task() and perf_pending_irq() can race with the
	 * task exiting.
	 */
	if (WARN_ON_ONCE(event->ctx->task != current))
	if (current->flags & PF_EXITING)
		return;

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

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