# CVE-2026-142895: maple\_tree: fix maple\_range\_64 crashes in RCU mode

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **Published:** 2026-12-03T03:25:45.799Z
- **Modified:** 2026-12-03T04:18:28.673Z

> **AI summary (AI-generated, claude-haiku-5-5):** An attacker who can trigger repeated maple tree insertions and RCU-deferred destruction can cause memory corruption and a crash in the Linux kernel.

## Who should check

- Anyone running Linux \>= 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa, \< 644bd517701ddff603a263414f8fbc44d81bd179; \>= 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa, \< 927794f131debefd81a1dbcb872008ebe345aeb2; \>= 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa, \< 2ef14d46311a598b1473717708fef505401ec8ff; \>= 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa, \< baed735a956f2a7badb5436bef6810303034f920
- Anyone running Linux 6.1

## Description

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

maple\_tree: fix maple\_range\_64 crashes in RCU mode

Patch series "maple\_tree: fix maple\_range\_64 crashes in RCU mode", v3.

The patch series fixes two RCU destroy path issues on maple\_range\_64
nodes.  Both arising from the fact that a maple\_range\_64 node repurposes
the last slot to hold metadata when the node is not full.  Patch 1
addresses the issues, and patch 2 adds a test used to catch them.

Currently there is no in-tree user of maple\_range\_64 nodes in RCU mode. 
All in-tree users of MT\_FLAGS\_USE\_RCU also set MT\_FLAGS\_ALLOC\_RANGE which
makes the internal nodes maple\_arange\_64.

Below is the minimal reproducer used during debugging:

static DEFINE\_MTREE(tree);
static int \_\_init maple\_fix\_init(void)
{
        unsigned long i, j;

        for (i = 10; i \< 4000; i++) {
                mt\_init\_flags(&tree, MT\_FLAGS\_USE\_RCU);

                for (j = 0; j \< i; j++) {
                        mtree\_insert\_range(&tree, j \* 10, j \* 10 + 9,
                                        xa\_mk\_value(j), GFP\_KERNEL);
                }

                mtree\_destroy(&tree);
                rcu\_barrier();
        }
        return 0;
}

The splat for the first issue addressed by the first patch is shown below.
mt\_clear\_meta() runs after the slots have been rewritten with raw
pointers by mte\_dead\_leaves(), so it cannot recognize a valid last pointer
because the type information is stripped.  On my 64-bit LE machine, it
clears bytes 248 and 249 of the maple\_range\_64 which are the two least
significant bytes of the last pointer.  The lowest byte is already zero,
since nodes are 256-byte aligned, but zeroing byte 249 corrupts the
pointer.

KASAN catches it as a double-free, because that corrupted pointer happens
to land on a node that was freed previously.  The splat appears at 226
insertions in the reproducer.  This is when the tree has a full root node
on a 64-bit build.

  ==================================================================
  BUG: KASAN: double-free in mt\_free\_walk+0x138/0x3a0
  Free of addr ffff0000f3d40000 by task swapper/2/0
  \[...\]
  Call trace:
   \[...\]
   kmem\_cache\_free\_bulk+0x5b8/0xc18
   mt\_free\_walk+0x138/0x3a0
   rcu\_core+0x5d0/0x1638
   rcu\_core\_si+0x18/0x30
   \[...\]

  Allocated by task 1218:
   \[...\]
   kmem\_cache\_alloc\_from\_sheaf\_noprof+0xa8/0x2f0
   dst\_setup+0x210/0x630
   mas\_wr\_split+0x568/0x26e0
   mas\_wr\_store\_entry+0x98c/0x1de0
   mas\_insert.isra.0+0x3d0/0x5d8
   mtree\_insert\_range+0xec/0x1c8
   maple\_fix\_init+0x94/0xff8 \[maple\_fix\_obj\]
   \[...\]

  Freed by task 0:
   \[...\]
   \_\_kasan\_slab\_free+0x88/0xb8
   \_\_rcu\_free\_sheaf\_prepare+0x94/0x360
   rcu\_free\_sheaf+0x30/0x138
   rcu\_core+0x5d0/0x1638
   rcu\_core\_si+0x18/0x30
   \[...\]

  The buggy address belongs to the object at ffff0000f3d40000
   which belongs to the cache maple\_node of size 256
  The buggy address is located 0 bytes inside of
   256-byte region \[ffff0000f3d40000, ffff0000f3d40100)

  \[...\]
  Memory state around the buggy address:
   ffff0000f3d3ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
   ffff0000f3d3ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
  \>ffff0000f3d40000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                     ^
   ffff0000f3d40080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
   ffff0000f3d40100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
  ==================================================================

The second issue fixed in the first patch is in the mt\_free\_walk().
mt\_free\_walk() descends by checking if the corresponding slot\[offset\]
entry is non-zero. In a maple\_range\_64 node that has
MAPLE\_RANGE64\_SLOTS-1 valid pointers to child nodes, all slots will be
non-zero, since the last slot holds the metadata. Thus, mte\_dead\_walk()
dereferences the metadata as if it were a node and hits the
null-ptr-deref as shown in the splat below.

After fixing the first issue, the reproducer reaches this case at 316
---truncated---

## Affected and fixed versions

- Linux: \>= 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa, \< 644bd517701ddff603a263414f8fbc44d81bd179; \>= 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa, \< 927794f131debefd81a1dbcb872008ebe345aeb2; \>= 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa, \< 2ef14d46311a598b1473717708fef505401ec8ff; \>= 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa, \< baed735a956f2a7badb5436bef6810303034f920 (cvelist)
- Linux: 6.1 (cvelist)

## Technologies

Linux kernel

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-142895. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-142895.md
Affected: Linux >= 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa, < 644bd517701ddff603a263414f8fbc44d81bd179; >= 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa, < 927794f131debefd81a1dbcb872008ebe345aeb2; >= 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa, < 2ef14d46311a598b1473717708fef505401ec8ff; >= 54a611b605901c7d5d05b6b…
Fixed in: Linux 644bd517701ddff603a263414f8fbc44d81bd179, Linux 927794f131debefd81a1dbcb872008ebe345aeb2, Linux 2ef14d46311a598b1473717708fef505401ec8ff

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-142895 being exploited?

There is no confirmed exploitation: CVE-2026-142895 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known.

### How serious is CVE-2026-142895?

It has no CVSS score yet. Unknown.

### Which versions are affected by CVE-2026-142895?

Linux \>= 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa, \< 644bd517701ddff603a263414f8fbc44d81bd179; \>= 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa, \< 927794f131debefd81a1dbcb872008ebe345aeb2; \>= 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa, \< 2ef14d46311a598b1473717708fef505401ec8ff; \>= 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa, \< baed735a956f2a7badb5436bef6810303034f920; Linux 6.1.

### Is there a fix for CVE-2026-142895?

Yes. Fixed in Linux 644bd517701ddff603a263414f8fbc44d81bd179, Linux 927794f131debefd81a1dbcb872008ebe345aeb2, Linux 2ef14d46311a598b1473717708fef505401ec8ff. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2026-142895?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- other: <https://git.kernel.org/stable/c/644bd517701ddff603a263414f8fbc44d81bd179>
- other: <https://git.kernel.org/stable/c/927794f131debefd81a1dbcb872008ebe345aeb2>
- other: <https://git.kernel.org/stable/c/2ef14d46311a598b1473717708fef505401ec8ff>
- other: <https://git.kernel.org/stable/c/baed735a956f2a7badb5436bef6810303034f920>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-142895>

HTML: <https://flawdb.com/CVE-2026-142895> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-142895>
