]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf: Fix __perf_event_overflow() vs perf_remove_from_context() race
authorPeter Zijlstra <peterz@infradead.org>
Tue, 24 Feb 2026 12:29:09 +0000 (13:29 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 25 Feb 2026 14:02:34 +0000 (15:02 +0100)
commitc9bc1753b3cc41d0e01fbca7f035258b5f4db0ae
treedfa7dc039675d6a1084c1eb2fc79e3330c0c3a65
parent77de62ad3de3967818c3dbe656b7336ebee461d2
perf: Fix __perf_event_overflow() vs perf_remove_from_context() race

Make sure that __perf_event_overflow() runs with IRQs disabled for all
possible callchains. Specifically the software events can end up running
it with only preemption disabled.

This opens up a race vs perf_event_exit_event() and friends that will go
and free various things the overflow path expects to be present, like
the BPF program.

Fixes: 592903cdcbf6 ("perf_counter: add an event_list")
Reported-by: Simond Hu <cmdhh1767@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Simond Hu <cmdhh1767@gmail.com>
Link: https://patch.msgid.link/20260224122909.GV1395416@noisy.programming.kicks-ass.net
kernel/events/core.c