{"id":"CVE-2023-54135","state":"PUBLISHED","title":"maple_tree: fix potential out-of-bounds access in mas_wr_end_piv()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nmaple_tree: fix potential out-of-bounds access in mas_wr_end_piv()\n\nCheck the write offset end bounds before using it as the offset into the\npivot array.  This avoids a possible out-of-bounds access on the pivot\narray if the write extends to the last slot in the node, in which case the\nnode maximum should be used as the end pivot.\n\nakpm: this doesn't affect any current callers, but new users of mapletree\nmay encounter this problem if backported into earlier kernels, so let's\nfix it in -stable kernels in case of this.","publishedAt":"2025-12-24T13:06:51.329Z","updatedAt":"2026-08-05T09:17:33.212Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"54a611b605901c7d5d05b6b8f5d04a6ceb0962aa","status":"affected","lessThan":"4e2ad53ababeaac44d71162650984abfe783960c","versionType":"git"},{"version":"54a611b605901c7d5d05b6b8f5d04a6ceb0962aa","status":"affected","lessThan":"dc4751bd4aba01ccfc02f91adfeee0ba4cda405c","versionType":"git"},{"version":"54a611b605901c7d5d05b6b8f5d04a6ceb0962aa","status":"affected","lessThan":"f5fcf6555a2a4f32947d17b92b173837cc652891","versionType":"git"},{"version":"54a611b605901c7d5d05b6b8f5d04a6ceb0962aa","status":"affected","lessThan":"cd00dd2585c4158e81fdfac0bbcc0446afbad26d","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.37","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.3.11","status":"unaffected","lessThanOrEqual":"6.3.*","versionType":"semver"},{"version":"6.4.1","status":"unaffected","lessThanOrEqual":"6.4.*","versionType":"semver"},{"version":"6.5","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/4e2ad53ababeaac44d71162650984abfe783960c","https://git.kernel.org/stable/c/dc4751bd4aba01ccfc02f91adfeee0ba4cda405c","https://git.kernel.org/stable/c/f5fcf6555a2a4f32947d17b92b173837cc652891","https://git.kernel.org/stable/c/cd00dd2585c4158e81fdfac0bbcc0446afbad26d"],"weaknesses":[],"ingestedAt":"2026-10-29T20:06:42.242Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2023/54xxx/CVE-2023-54135.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2023-54135","state":"PUBLISHED","datePublished":"2025-12-24T13:06:51.329Z","dateUpdated":"2026-08-05T09:17:33.212Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-12-24T13:02:52.522Z"},"containers":{"cna":{"title":"maple_tree: fix potential out-of-bounds access in mas_wr_end_piv()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nmaple_tree: fix potential out-of-bounds access in mas_wr_end_piv()\n\nCheck the write offset end bounds before using it as the offset into the\npivot array.  This avoids a possible out-of-bounds access on the pivot\narray if the write extends to the last slot in the node, in which case the\nnode maximum should be used as the end pivot.\n\nakpm: this doesn't affect any current callers, but new users of mapletree\nmay encounter this problem if backported into earlier kernels, so let's\nfix it in -stable kernels in case of this."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"54a611b605901c7d5d05b6b8f5d04a6ceb0962aa","status":"affected","lessThan":"4e2ad53ababeaac44d71162650984abfe783960c","versionType":"git"},{"version":"54a611b605901c7d5d05b6b8f5d04a6ceb0962aa","status":"affected","lessThan":"dc4751bd4aba01ccfc02f91adfeee0ba4cda405c","versionType":"git"},{"version":"54a611b605901c7d5d05b6b8f5d04a6ceb0962aa","status":"affected","lessThan":"f5fcf6555a2a4f32947d17b92b173837cc652891","versionType":"git"},{"version":"54a611b605901c7d5d05b6b8f5d04a6ceb0962aa","status":"affected","lessThan":"cd00dd2585c4158e81fdfac0bbcc0446afbad26d","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.37","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.3.11","status":"unaffected","lessThanOrEqual":"6.3.*","versionType":"semver"},{"version":"6.4.1","status":"unaffected","lessThanOrEqual":"6.4.*","versionType":"semver"},{"version":"6.5","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/4e2ad53ababeaac44d71162650984abfe783960c"},{"url":"https://git.kernel.org/stable/c/dc4751bd4aba01ccfc02f91adfeee0ba4cda405c"},{"url":"https://git.kernel.org/stable/c/f5fcf6555a2a4f32947d17b92b173837cc652891"},{"url":"https://git.kernel.org/stable/c/cd00dd2585c4158e81fdfac0bbcc0446afbad26d"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The maple tree write path is reached only through local syscalls — `mmap()`, `munmap()`, `mprotect()`, `mremap()`, `brk()` via `vma_iter_store*()`/`vma_iter_clear*()` → `mas_store_gfp()`/`mas_store_prealloc()` → `mas_wr_end_piv()`. The other in-tree users (btrfs send LRU cache, regcache-maple) are likewise local/driver-internal, with no remote packet-processing path.\nAC:L - The trigger is a completely full 16-slot leaf node plus a store whose range starts in an earlier slot and ends inside the final slot — a tree shape an unprivileged attacker deterministically constructs by creating thousands of non-mergeable VMAs and then unmapping a spanning range. No race and no memory layout outside the attacker's influence is involved.\nPR:L - Any unprivileged local process reaches the code with plain `mmap()`/`munmap()` calls on its own address space; there is no capability check, LSM gate, or namespace requirement anywhere along `do_vmi_align_munmap()` → `vma_iter_clear_gfp()` → `mas_wr_store_entry()`.\nUI:N - The attacking process triggers the faulty write path entirely through its own address-space syscalls; no victim action, mount, or file open is required.\nS:U - The out-of-bounds pivot read and the resulting maple-tree corruption are confined to the kernel's own memory-management structures, which are the same security authority as the compromised kernel. No VM, IOMMU, or sandbox boundary is crossed.\nC:H - The array overrun reads a live kernel pointer (`slot[0]`, a `struct vm_area_struct *`) and turns it into a range boundary, and the resulting `mas->last`/`new_end` corruption leaves stale VMA pointers and bogus ranges in the VMA tree — memory corruption that can be leveraged into an arbitrary-read primitive, and whose pivot values are indirectly observable through mmap gap placement.\nI:H - A bogus `end_piv` propagates into `mas_wr_extend_null()`, which can set `mas->last` to a kernel heap pointer value beyond the node's `mas->max`, and into `mas_wr_node_store()`'s `new_end` computation, causing the store to overwrite the wrong ranges and leave stale slots — VMA-tree corruption exploitable for use-after-free and arbitrary-write primitives.\nA:H - Writing a range past the node maximum and leaving stale slots violates maple-tree invariants, producing `MT_BUG_ON`/`VM_BUG_ON` hits, oopses, or use-after-free on `vm_area_struct` during any subsequent tree walk or address-space teardown, crashing the kernel."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T09:17:33.212Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1","versionEndExcluding":"6.1.37"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1","versionEndExcluding":"6.3.11"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1","versionEndExcluding":"6.4.1"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1","versionEndExcluding":"6.5"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}