Critical Vulnerability in Linux Kernel: mmap() Crash in Persistent Ring Buffer
Summary
DEBIAN-CVE-2025-21778: In the Linux kernel, the following vulnerability has been resolved: tracing: Do not allow mmap() of persistent ring buffer When trying to mmap a trace instance buffer that is attached to reserve_mem, it would crash: BUG:... Affects linux versions < 6.12.16-1. Fixed in 6.12.16-1. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The Linux kernel is the core component of the Linux operating system, responsible for managing hardware resources and providing essential services to applications. It supports a wide range of functionalities, including process management, memory management, and device control. This vulnerability specifically affects the mmap() functionality of the persistent ring buffer, which is used for tracing and logging events in the kernel. The issue arises when attempting to map a trace instance buffer that is attached to reserved memory, leading to a crash.
Vulnerability Detail
In the Linux kernel, a vulnerability has been identified where the mmap() function can cause a crash when used with a persistent ring buffer attached to reserved memory. This occurs due to improper handling of memory mapping, which results in a page fault when the kernel attempts to access a non-present page. The crash manifests as a bug report indicating an inability to handle a page fault, which can lead to system instability and potential data loss. The root cause is linked to the use of virt_to_page() on vmap()'d memory, which is not compatible with the persistent ring buffer's memory management.
How To Fix
Minimum fixed version
6.12.16-1
This is the first release that contains the fix.
sudo apt-get install --only-upgrade linux
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, users should avoid using mmap() on instances that have their ring buffer from the reserve_mem option. If mmap() is attempted on a persistent buffer, it will return -ENODEV, indicating that the operation is not permitted.
Conclusion
The identified vulnerability in the Linux kernel poses a significant risk when using mmap() with persistent ring buffers. Users are advised to update to the patched version to ensure system stability and security. Temporary workarounds are available, but updating is the best long-term solution.
See every vulnerability recorded for linux →
FAQ
The vulnerability can lead to system crashes and instability when using mmap() on certain trace buffers, potentially resulting in data loss.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
If an immediate update is not possible, avoid using mmap() on persistent ring buffers as a temporary workaround.
This vulnerability affects the Linux kernel across various distributions, particularly those using the affected versions of the kernel.
You can refer to the official Linux kernel mailing lists, security advisories, and vulnerability databases for detailed information.
References
Related vulnerabilities
Recent vulnerabilities recorded for linux.