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-&gt;mmap_count *without* holding<br /> event-&gt;mmap_mutex (the refcount_dec_and_test() right before the<br /> refcount_dec_and_mutex_lock() of event-&gt;mmap_count). A concurrent<br /> perf_mmap_rb() can slot its entire "revival" path into that window<br /> (perf_mmap holds event-&gt;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-&gt;mmap_count 1 -&gt; 0 (no lock) (holds event-&gt;mmap_mutex)<br /> inc_not_zero(rb-&gt;mmap_count) fails<br /> ring_buffer_attach(event, NULL)<br /> rb_alloc() + attach new rb<br /> refcount_set(&amp;event-&gt;mmap_count, 1)<br /> lock; event-&gt;mmap_count 1 -&gt; 0<br /> ring_buffer_attach(event, NULL)<br /> ring_buffer_put() -&gt; frees the *new* rb<br /> <br /> The revival&amp;#39;s refcount_set(&amp;event-&gt;mmap_count, 1) is an invisible<br /> 1 -&gt; 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-&gt;mmap_count is<br /> dropped first via refcount_dec_and_mutex_lock(), so its 1 -&gt; 0<br /> transition and the ring_buffer_attach() stay serialized with<br /> perf_mmap(). rb-&gt;mmap_count == 0 then implies every event using the<br /> buffer is detached already, so the result of the rb-&gt;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-&gt;mmap_mutex around both counter updates [0]; here the not-last<br /> close stays lockless.