Kernel Vulnerability in Linux Package: Flag-Dropping Behavior in KSM_MADVISE
Summary
DEBIAN-CVE-2025-40040: In the Linux kernel, the following vulnerability has been resolved: mm/ksm: fix flag-dropping behavior in ksm_madvise syzkaller discovered the following crash: (kernel BUG) [ 44.607039] ------------[ cut here ]----------... Affects linux versions 6.1.106-1 – 6.9.9-1. No fix is published. 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 many operating systems, managing hardware resources and providing essential services for software applications. It is known for its stability, performance, and security features. However, vulnerabilities can arise, impacting system integrity and performance. This specific vulnerability affects the Linux kernel versions included in Debian 12, 13, and 14, exposing systems to potential crashes and inconsistent states.
Vulnerability Detail
In the Linux kernel, a vulnerability was discovered related to the KSM (Kernel Same-page Merging) functionality. The issue arises when the user calls madvise() with the MADV_UNMERGEABLE option on a Virtual Memory Area (VMA) that is registered for Userfaultfd (UFFD) in MINOR mode. This operation inadvertently clears critical flags in the upper bits of vma->vm_flags, leading to a kernel panic due to UFFD inconsistency during the userfaultfd_release_all() function. The root cause is a type mismatch during bitwise operations, which can result in system crashes and instability.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
Currently, there are no specific workarounds mentioned for this vulnerability. The best course of action is to apply the patch by updating the Linux package as described above.
Conclusion
The vulnerability in the Linux kernel related to KSM_MADVISE poses significant risks, including system crashes and instability. It is crucial for users to update their Linux packages to the latest patched versions to mitigate these risks effectively.
See every vulnerability recorded for linux →
FAQ
The vulnerability can lead to kernel panics, causing system crashes and potential data loss.
The vulnerability affects the Linux kernel versions in Debian 12, 13, and 14.
You can use the Vulert platform to monitor and alert for open-source vulnerabilities in your software by analyzing your manifest file.
Currently, there are no specific workarounds available. Updating the package is the recommended solution.
Detailed information can be found in the official CVE report and through security advisories related to the Linux kernel.
References
Related vulnerabilities
Recent vulnerabilities recorded for linux.