CVE-2026-89791
Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
16/09/2026
Last modified:
19/10/2026
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
perf: Fix use-after-free when perf mmap() revival races with the last munmap()<br />
<br />
perf_mmap_close() drops rb->mmap_count *without* holding<br />
event->mmap_mutex (the refcount_dec_and_test() right before the<br />
refcount_dec_and_mutex_lock() of event->mmap_count). A concurrent<br />
perf_mmap_rb() can slot its entire "revival" path into that window<br />
(perf_mmap holds event->mmap_mutex for its whole duration, including<br />
rb_alloc):<br />
<br />
munmap side (perf_mmap_close) mmap side (perf_mmap_rb)<br />
----------------------------------- --------------------------------<br />
rb->mmap_count 1 -> 0 (no lock) (holds event->mmap_mutex)<br />
inc_not_zero(rb->mmap_count) fails<br />
ring_buffer_attach(event, NULL)<br />
rb_alloc() + attach new rb<br />
refcount_set(&event->mmap_count, 1)<br />
lock; event->mmap_count 1 -> 0<br />
ring_buffer_attach(event, NULL)<br />
ring_buffer_put() -> frees the *new* rb<br />
<br />
The revival&#39;s refcount_set(&event->mmap_count, 1) is an invisible<br />
1 -> 1 write: the close frees the just-revived buffer although the<br />
other process still has it mapped -- a page-level use-after-free<br />
allowing local privilege escalation to root by any unprivileged user<br />
(default kernel.perf_event_paranoid=2).<br />
<br />
Swap the order of the two counter updates: event->mmap_count is<br />
dropped first via refcount_dec_and_mutex_lock(), so its 1 -> 0<br />
transition and the ring_buffer_attach() stay serialized with<br />
perf_mmap(). rb->mmap_count == 0 then implies every event using the<br />
buffer is detached already, so the result of the rb->mmap_count drop<br />
can gate the remaining teardown directly and detach_rest is no longer<br />
needed.<br />
<br />
An earlier fix for this race from Kyle Zeng and David Lee takes<br />
event->mmap_mutex around both counter updates [0]; here the not-last<br />
close stays lockless.
Impact
Base Score 3.x
7.80
Severity 3.x
HIGH


