PT-2026-166632

CVE-2026-142895

·

Published

2026-12-03

·

Updated

2026-12-03

Description by

Score
N/A
Not available

No severity ratings or metrics are available. When they are, we'll update the corresponding info on the page.

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---
Vendors
Affected products
Related identifiers
Found an issue in the description? Have something to add? Feel free to write us 👾