# CVE-2025-38364: maple_tree: fix MA_STATE_PREALLOC flag in mas_preallocate()

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.20%, higher than 9% of CVEs (2026-12-01)
- Published: 2025-07-25T12:47:34.548Z
- Modified: 2026-11-05T21:18:29.183Z
- Weaknesses: CWE-476
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

maple_tree: fix MA_STATE_PREALLOC flag in mas_preallocate()

Temporarily clear the preallocation flag when explicitly requesting
allocations.  Pre-existing allocations are already counted against the
request through mas_node_count_gfp(), but the allocations will not happen
if the MA_STATE_PREALLOC flag is set.  This flag is meant to avoid
re-allocating in bulk allocation mode, and to detect issues with
preallocation calculations.

The MA_STATE_PREALLOC flag should also always be set on zero allocations
so that detection of underflow allocations will print a WARN_ON() during
consumption.

User visible effect of this flaw is a WARN_ON() followed by a null pointer
dereference when subsequent requests for larger number of nodes is
ignored, such as the vma merge retry in mmap_region() caused by drivers
altering the vma flags (which happens in v6.6, at least)

(As written by CVE List.)

## Affected

- Linux Linux: from 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa before d69cd64bd5af41c6fd409313504089970edaf02f; from 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa before e63032e66bca1d06e600033f3369ba3db3af0870; from 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa before cf95f8426f889949b738f51ffcd72884411f3a6a; from 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa before 9e32f4700867abbd5d19abfcf698dbd0d2ce36a4; from 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa before fba46a5d83ca8decb338722fb4899026d8d9ead2; 6.1 (not affected: before 6.1; from 6.1.146 up to 6.1.*; from 6.6.99 up to 6.6.*; from 6.12.36 up to 6.12.*; from 6.15.5 up to 6.15.*; from 6.16 up to *)
- linux linux_kernel: from 6.1 before 6.1.146; from 6.2 before 6.6.99; from 6.7 before 6.12.36; from 6.13 before 6.15.5; 6.16
- debian debian_linux: 11.0

## References

- <https://git.kernel.org/stable/c/d69cd64bd5af41c6fd409313504089970edaf02f> (patch)
- <https://git.kernel.org/stable/c/e63032e66bca1d06e600033f3369ba3db3af0870> (patch)
- <https://git.kernel.org/stable/c/cf95f8426f889949b738f51ffcd72884411f3a6a> (patch)
- <https://git.kernel.org/stable/c/9e32f4700867abbd5d19abfcf698dbd0d2ce36a4> (patch)
- <https://git.kernel.org/stable/c/fba46a5d83ca8decb338722fb4899026d8d9ead2> (patch)
- <https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html> (third-party-advisory)
- <https://cert-portal.siemens.com/productcert/html/ssa-082556.html>

## Sources

- CVE List: [CVE-2025-38364](https://www.cve.org/CVERecord?id=CVE-2025-38364), CVE Terms of Use, modified 2026-11-05
- NVD: [CVE-2025-38364](https://nvd.nist.gov/vuln/detail/CVE-2025-38364), Public domain, modified 2026-11-05

---

Page: https://cve.day/CVE-2025-38364 · Whole record: https://cve.day/CVE-2025-38364.json · Rebuilt by cve.day 2026-11-25T22:59:01.667Z
