{"id":"CVE-2025-38364","state":"PUBLISHED","title":"maple_tree: fix MA_STATE_PREALLOC flag in mas_preallocate()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nmaple_tree: fix MA_STATE_PREALLOC flag in mas_preallocate()\n\nTemporarily clear the preallocation flag when explicitly requesting\nallocations.  Pre-existing allocations are already counted against the\nrequest through mas_node_count_gfp(), but the allocations will not happen\nif the MA_STATE_PREALLOC flag is set.  This flag is meant to avoid\nre-allocating in bulk allocation mode, and to detect issues with\npreallocation calculations.\n\nThe MA_STATE_PREALLOC flag should also always be set on zero allocations\nso that detection of underflow allocations will print a WARN_ON() during\nconsumption.\n\nUser visible effect of this flaw is a WARN_ON() followed by a null pointer\ndereference when subsequent requests for larger number of nodes is\nignored, such as the vma merge retry in mmap_region() caused by drivers\naltering the vma flags (which happens in v6.6, at least)","publishedAt":"2025-07-25T12:47:34.548Z","updatedAt":"2026-10-15T01:07:09.909Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"54a611b605901c7d5d05b6b8f5d04a6ceb0962aa","status":"affected","lessThan":"d69cd64bd5af41c6fd409313504089970edaf02f","versionType":"git"},{"version":"54a611b605901c7d5d05b6b8f5d04a6ceb0962aa","status":"affected","lessThan":"e63032e66bca1d06e600033f3369ba3db3af0870","versionType":"git"},{"version":"54a611b605901c7d5d05b6b8f5d04a6ceb0962aa","status":"affected","lessThan":"cf95f8426f889949b738f51ffcd72884411f3a6a","versionType":"git"},{"version":"54a611b605901c7d5d05b6b8f5d04a6ceb0962aa","status":"affected","lessThan":"9e32f4700867abbd5d19abfcf698dbd0d2ce36a4","versionType":"git"},{"version":"54a611b605901c7d5d05b6b8f5d04a6ceb0962aa","status":"affected","lessThan":"fba46a5d83ca8decb338722fb4899026d8d9ead2","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["lib/maple_tree.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.1","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.1","versionType":"semver"},{"version":"6.1.146","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.99","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.36","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.15.5","status":"unaffected","lessThanOrEqual":"6.15.*","versionType":"semver"},{"version":"6.16","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["lib/maple_tree.c"]}],"references":["https://git.kernel.org/stable/c/d69cd64bd5af41c6fd409313504089970edaf02f","https://git.kernel.org/stable/c/e63032e66bca1d06e600033f3369ba3db3af0870","https://git.kernel.org/stable/c/cf95f8426f889949b738f51ffcd72884411f3a6a","https://git.kernel.org/stable/c/9e32f4700867abbd5d19abfcf698dbd0d2ce36a4","https://git.kernel.org/stable/c/fba46a5d83ca8decb338722fb4899026d8d9ead2","https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html","https://cert-portal.siemens.com/productcert/html/ssa-082556.html"],"weaknesses":[],"ingestedAt":"2026-10-29T20:09:09.358Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/38xxx/CVE-2025-38364.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-38364","state":"PUBLISHED","datePublished":"2025-07-25T12:47:34.548Z","dateUpdated":"2026-10-15T01:07:09.909Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-04-16T04:51:24.008Z"},"containers":{"cna":{"title":"maple_tree: fix MA_STATE_PREALLOC flag in mas_preallocate()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nmaple_tree: fix MA_STATE_PREALLOC flag in mas_preallocate()\n\nTemporarily clear the preallocation flag when explicitly requesting\nallocations.  Pre-existing allocations are already counted against the\nrequest through mas_node_count_gfp(), but the allocations will not happen\nif the MA_STATE_PREALLOC flag is set.  This flag is meant to avoid\nre-allocating in bulk allocation mode, and to detect issues with\npreallocation calculations.\n\nThe MA_STATE_PREALLOC flag should also always be set on zero allocations\nso that detection of underflow allocations will print a WARN_ON() during\nconsumption.\n\nUser visible effect of this flaw is a WARN_ON() followed by a null pointer\ndereference when subsequent requests for larger number of nodes is\nignored, such as the vma merge retry in mmap_region() caused by drivers\naltering the vma flags (which happens in v6.6, at least)"}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"54a611b605901c7d5d05b6b8f5d04a6ceb0962aa","status":"affected","lessThan":"d69cd64bd5af41c6fd409313504089970edaf02f","versionType":"git"},{"version":"54a611b605901c7d5d05b6b8f5d04a6ceb0962aa","status":"affected","lessThan":"e63032e66bca1d06e600033f3369ba3db3af0870","versionType":"git"},{"version":"54a611b605901c7d5d05b6b8f5d04a6ceb0962aa","status":"affected","lessThan":"cf95f8426f889949b738f51ffcd72884411f3a6a","versionType":"git"},{"version":"54a611b605901c7d5d05b6b8f5d04a6ceb0962aa","status":"affected","lessThan":"9e32f4700867abbd5d19abfcf698dbd0d2ce36a4","versionType":"git"},{"version":"54a611b605901c7d5d05b6b8f5d04a6ceb0962aa","status":"affected","lessThan":"fba46a5d83ca8decb338722fb4899026d8d9ead2","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["lib/maple_tree.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.1","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.1","versionType":"semver"},{"version":"6.1.146","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.99","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.36","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.15.5","status":"unaffected","lessThanOrEqual":"6.15.*","versionType":"semver"},{"version":"6.16","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["lib/maple_tree.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/d69cd64bd5af41c6fd409313504089970edaf02f"},{"url":"https://git.kernel.org/stable/c/e63032e66bca1d06e600033f3369ba3db3af0870"},{"url":"https://git.kernel.org/stable/c/cf95f8426f889949b738f51ffcd72884411f3a6a"},{"url":"https://git.kernel.org/stable/c/9e32f4700867abbd5d19abfcf698dbd0d2ce36a4"},{"url":"https://git.kernel.org/stable/c/fba46a5d83ca8decb338722fb4899026d8d9ead2"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-05-11T21:26:33.668Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1","versionEndExcluding":"6.1.146"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1","versionEndExcluding":"6.6.99"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1","versionEndExcluding":"6.12.36"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1","versionEndExcluding":"6.15.5"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1","versionEndExcluding":"6.16"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CVE Program Container","references":[{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-11-03T17:37:07.665Z"}},{"affected":[{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.5","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.5","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.5","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.5","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIPLUS S7-1500 CPU 1518-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.5","status":"affected","lessThan":"*","versionType":"custom"}]}],"references":[{"url":"https://cert-portal.siemens.com/productcert/html/ssa-082556.html"}],"providerMetadata":{"shortName":"siemens-SADP","orgId":"0b142b55-0307-4c5a-b3c9-f314f3fb7c5e","dateUpdated":"2026-10-15T01:07:09.909Z"},"x_adpType":"supplier"}]}}}