UBUNTU-CVE-2026-89791: Use After Free
In the Linux kernel, the following vulnerability has been resolved: perf: Fix use-after-free when perf mmap() revival races with the last munmap() perfmmapclose() drops rb->mmapcount without holding event->mmapmutex (the refcountdecandtest() right before the refcountdecandmutexlock() of event->mmapcount). A concurrent perfmmaprb() can slot its entire "revival" path into that window (perfmmap holds event->mmapmutex for its whole duration, including rballoc): munmap side (perfmmapclose) mmap side (perfmmaprb) ----------------------------------- -------------------------------- rb->mmapcount 1 -> 0 (no lock) (holds event->mmapmutex) incnotzero(rb->mmapcount) fails ringbufferattach(event, NULL) rballoc() + attach new rb refcountset(&event->mmapcount, 1) lock; event->mmapcount 1 -> 0 ringbufferattach(event, NULL) ringbufferput() -> frees the new rb The revival's refcountset(&event->mmapcount, 1) is an invisible 1 -> 1 write: the close frees the just-revived buffer although the other process still has it mapped -- a page-level use-after-free allowing local privilege escalation to root by any unprivileged user (default kernel.perfeventparanoid=2). Swap the order of the two counter updates: event->mmapcount is dropped first via refcountdecandmutexlock(), so its 1 -> 0 transition and the ringbufferattach() stay serialized with perfmmap(). rb->mmapcount == 0 then implies every event using the buffer is detached already, so the result of the rb->mmapcount drop can gate the remaining teardown directly and detachrest is no longer needed. An earlier fix for this race from Kyle Zeng and David Lee takes event->mmapmutex around both counter updates [0]; here the not-last close stays lockless.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ubuntu/linux-hwe-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42~24.04.1 - Upgrade
Upgrade
ubuntu/linux-riscv-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1~24.04.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 7.0.0-42.42 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 7.0.0-1016.17 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 7.0.0-1016.18 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oem-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 7.0.0-1015.16 - Upgrade
Upgrade
ubuntu/linux-riscvto a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1
Event History
Frequently Asked Questions
Who can exploit this issue under the default configuration?
Any unprivileged local user can exploit the race for local privilege escalation to root when the default kernel.perf_event_paranoid=2 setting is in use.
What conditions are required for exploitation?
An attacker needs local access and must trigger a race between perf mmap() revival and the final munmap() path, causing a newly revived perf ring buffer to be freed while it remains mapped.
Which Ubuntu kernel packages are listed as affected?
The listed packages are ubuntu/linux-riscv, ubuntu/linux-realtime, ubuntu/linux-hwe-edge, ubuntu/linux-azure, ubuntu/linux-gcp, ubuntu/linux-azure-fde, ubuntu/linux-gke, and ubuntu/linux-aws-5.0.