CVE-2025-38563: Linux Kernel perf Subsystem AUX Buffers Use-After-Free Local Privilege Escalation Vulnerability
In the Linux kernel, the following vulnerability has been resolved:
perf/core: Prevent VMA split of buffer mappings
The perf mmap code is careful about mmap()'ing the user page with the ringbuffer and additionally the auxiliary buffer, when the event supports it. Once the first mapping is established, subsequent mapping have to use the same offset and the same size in both cases. The reference counting for the ringbuffer and the auxiliary buffer depends on this being correct.
Though perf does not prevent that a related mapping is split via mmap(2), munmap(2) or mremap(2). A split of a VMA results in perfmmapopen() calls, which take reference counts, but then the subsequent perfmmapclose() calls are not longer fulfilling the offset and size checks. This leads to reference count leaks.
As perf already has the requirement for subsequent mappings to match the initial mapping, the obvious consequence is that VMA splits, caused by resizing of a mapping or partial unmapping, have to be prevented.
Implement the vmoperationsstruct::maysplit() callback and return unconditionally -EINVAL.
That ensures that the mapping offsets and sizes cannot be changed after the fact. Remapping to a different fixed address with the same size is still possible as it takes the references for the new mapping and drops those of the old mapping.
Other sources
This vulnerability allows local attackers to escalate privileges on affected installations of Linux Kernel. An attacker must first obtain the ability to execute high-privileged code on the target system in order to exploit this vulnerability. The specific flaw exists within the handling of reference counters. The issue results from the lack of validating the existence of an object prior to performing operations on the object. An attacker can leverage this vulnerability to escalate privileges and execute arbitrary code in the context of the kernel.
— ZDI
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2025-38563?
CVE-2025-38563 is classified as a medium severity vulnerability in the Linux kernel.
How do I fix CVE-2025-38563?
To fix CVE-2025-38563, update your Linux kernel to the latest patched version provided by your distribution.
What impact does CVE-2025-38563 have on system security?
CVE-2025-38563 could potentially allow unauthorized access or manipulation of memory mappings affecting system stability.
Which versions of the Linux kernel are affected by CVE-2025-38563?
CVE-2025-38563 affects multiple versions of the Linux kernel prior to the latest security patches.
Is CVE-2025-38563 remotely exploitable?
CVE-2025-38563 is not remotely exploitable, as it requires local access to the system to be an effective threat.