CVE-2025-38563 Overview
CVE-2025-38563 is a Linux kernel vulnerability in the perf/core subsystem. The flaw stems from the perf mmap code failing to prevent virtual memory area (VMA) splits of buffer mappings. When a mapping is split via mmap(2), munmap(2), or mremap(2), perf_mmap_open() acquires reference counts that subsequent perf_mmap_close() calls cannot properly release. This results in reference count leaks on the ringbuffer and auxiliary buffer. A local, low-privileged attacker can trigger this condition to impact kernel memory integrity and availability. The vulnerability affects the Linux kernel and downstream distributions such as Debian.
Critical Impact
A local authenticated user can trigger reference count leaks in the perf subsystem, leading to kernel memory exhaustion, potential use-after-free conditions, and denial of service. Zero Day Initiative tracks this issue as ZDI-25-873.
Affected Products
- Linux Kernel (multiple stable branches prior to fixed commits)
- Debian Linux 11.0
- Distributions shipping vulnerable upstream kernels
Discovery Timeline
- 2025-08-19 - CVE-2025-38563 published to NVD
- 2025-10-07 - Debian LTS security announcement issued
- 2025-10-08 - Additional Debian LTS security announcement issued
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2025-38563
Vulnerability Analysis
The perf subsystem exposes a user page containing the ringbuffer and, for events that support it, an auxiliary buffer through mmap(). The kernel enforces that once the first mapping is established, all subsequent mappings must use the same offset and size. Reference counting for both buffers depends on this invariant holding across the mapping lifecycle.
The kernel did not prevent related mappings from being split. Operations such as mremap(2) to resize a mapping or munmap(2) on a partial range cause the kernel VMA layer to split the original VMA into multiple VMAs. Each resulting VMA triggers a perf_mmap_open() callback that increments reference counts. However, when those VMAs are later closed, perf_mmap_close() cannot satisfy the offset and size checks required to release references correctly.
Root Cause
The vm_operations_struct used by perf mmap regions did not implement a may_split() callback. Without this hook, the memory management layer defaults to allowing VMA splits. This design assumption conflicted with perf's requirement that buffer mappings remain contiguous and unchanged after creation, causing an asymmetric increment and decrement of internal reference counters [CWE-noinfo].
Attack Vector
Exploitation requires local access with permissions to open a perf_event_open(2) file descriptor and create the initial mmap region. An attacker then invokes mremap() or munmap() on a subrange of the perf buffer mapping to force a VMA split. Repeated splits leak references on the ringbuffer and auxiliary buffer, preventing their deallocation and enabling kernel memory pressure or unsafe object lifetimes. The upstream fix implements vm_operations_struct::may_split() and unconditionally returns -EINVAL, blocking any split while still permitting whole-mapping mremap to a new fixed address.
No public proof-of-concept code has been released. Technical details are described in the Zero Day Initiative Advisory ZDI-25-873 and the upstream commits linked below.
Detection Methods for CVE-2025-38563
Indicators of Compromise
- Unexpected growth in kernel slab allocations tied to perf_event and ring_buffer objects without corresponding process termination cleanup.
- Processes repeatedly invoking perf_event_open(2) followed by mremap(2) or partial munmap(2) against perf buffer regions.
- Kernel warnings, oopses, or out-of-memory events referencing perf_mmap_close or ring_buffer_put.
Detection Strategies
- Audit perf_event_open syscall usage through auditd or eBPF probes and flag processes that combine perf mmap with mapping-modification syscalls.
- Correlate /proc/<pid>/maps snapshots against kernel slab statistics to identify anomalous perf buffer retention.
- Monitor kernel logs for repeated allocation failures or reference count warnings originating in kernel/events/core.c.
Monitoring Recommendations
- Enable syscall telemetry on Linux workloads and alert on unusual mremap/munmap patterns targeting perf ring buffers.
- Track kernel version inventory across the fleet to ensure Debian and upstream kernel packages are patched to the fixed commits.
- Establish baselines for perf_event usage in production so anomalous local activity by non-privileged accounts stands out.
How to Mitigate CVE-2025-38563
Immediate Actions Required
- Apply vendor-supplied kernel updates from Debian and other affected distributions referenced in the Debian LTS Announcement 2025-10-07 and Debian LTS Announcement 2025-10-08.
- Reboot systems after kernel package upgrades to ensure the fixed kernel image is active.
- Restrict perf_event_open(2) access on multi-tenant hosts by setting kernel.perf_event_paranoid to 3.
Patch Information
The upstream fix implements the may_split() callback in the perf VMA operations to reject any split of a perf buffer mapping. Backports have been merged across stable branches in the following commits: 3bd518c, 65311aa, 6757a31, 7b84cb5, b024d7b, d52451a, e4346ff, e529888, and ff66893.
Workarounds
- Set kernel.perf_event_paranoid=3 via sysctl to disallow perf_event_open for unprivileged users, removing the local attack surface until patches are applied.
- Remove or restrict CAP_PERFMON and CAP_SYS_ADMIN from container workloads and untrusted local accounts.
- Where perf is not required, disable CONFIG_PERF_EVENTS in custom kernel builds.
# Restrict perf_event_open to root only and persist the setting
sudo sysctl -w kernel.perf_event_paranoid=3
echo 'kernel.perf_event_paranoid = 3' | sudo tee /etc/sysctl.d/90-perf-hardening.conf
# Verify installed kernel version after patching (Debian example)
apt-get update && apt-get install --only-upgrade linux-image-$(uname -r | cut -d- -f2-)
uname -r
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

