CVE-2025-38364: maple_tree: fix MA_STATE_PREALLOC flag in mas_preallocate()
In the Linux kernel, the following vulnerability has been resolved:
mapletree: fix MASTATEPREALLOC flag in maspreallocate()
Temporarily clear the preallocation flag when explicitly requesting allocations. Pre-existing allocations are already counted against the request through masnodecountgfp(), but the allocations will not happen if the MASTATEPREALLOC flag is set. This flag is meant to avoid re-allocating in bulk allocation mode, and to detect issues with preallocation calculations.
The MASTATEPREALLOC flag should also always be set on zero allocations so that detection of underflow allocations will print a WARNON() during consumption.
User visible effect of this flaw is a WARNON() followed by a null pointer dereference when subsequent requests for larger number of nodes is ignored, such as the vma merge retry in mmapregion() caused by drivers altering the vma flags (which happens in v6.6, at least)
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2025-38364?
CVE-2025-38364 has not been assigned a severity score yet by the National Vulnerability Database.
How do I fix CVE-2025-38364?
To fix CVE-2025-38364, update the Linux kernel to version 6.6 or later.
What types of systems are affected by CVE-2025-38364?
CVE-2025-38364 affects systems running the Linux kernel version 6.6 and earlier versions.
What component of the Linux kernel does CVE-2025-38364 involve?
CVE-2025-38364 involves the maple_tree implementation and its allocation process.
Is there a workaround for CVE-2025-38364?
The recommended action for CVE-2025-38364 is to apply the patch or upgrade the kernel, as no specific workaround has been provided.