CVE-2026-143171: mm/mempolicy: read the zoneref slot once in mempolicy_slab_node()
In the Linux kernel, the following vulnerability has been resolved:
mm/mempolicy: read the zoneref slot once in mempolicyslabnode()
For a bind or preferred-many policy, mempolicyslabnode() tests the first matching slot's zone for NULL, then reads the slot again to look up the zone's node. Offlining a zone's last block rebuilds the zonelists in place, so the second read can return the terminator:
CPU 0 CPU 1 mempolicyslabnode() zonelistzone(slot 4) = node 2 NORMAL offlinepages() buildallzonelists() slot 4 = NULL zonelistnodeidx(slot 4) zonetonid(NULL)
Current GCC merges the two reads, but nothing requires it. With mm/mempolicy.o built with -fno-inline -fno-ipa-sra, holding a bound task's slabstrictnuma allocation between the reads while a movable block earlier in the zonelist goes offline oopses every time:
BUG: kernel NULL pointer dereference, address: 0000000000000060 RIP: 0010:zonetonid+0x0/0x10 Call Trace: kmemcacheallocnoprof+0x294/0x610 dogetname+0x34/0x230
mempolicyslabnode() and zonelistnodeidx() are tail calls here, so neither appears in the trace.
Read the slot once and use that zone.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In mm/mempolicy_slab_node(), read the zoneref slot once and use that zone for the NULL check and node lookup.
Event History
Frequently Asked Questions
Which systems are exposed to this race condition?
Systems are exposed when tasks use bind or preferred-many memory policies and execute slab allocations under strict NUMA placement while zonelists are being rebuilt due to zone memory offlining. The demonstrated failure involves offlining a zone's last block, with a movable block earlier in the zonelist.
What is required to trigger the failure?
The race requires a slab allocation for a task with a bound memory policy to occur between two accesses to the same zonelist slot while concurrent memory offlining rebuilds the zonelists in place. If the slot changes from a valid zone to the NULL terminator between those accesses, the kernel can dereference NULL.
How can I recognize that this issue has occurred?
A successful trigger can cause a kernel NULL pointer dereference at address 0x60, with zone_to_nid in the instruction pointer or call trace. The trace may show kmem_cache_alloc_noprof and do_getname, while mempolicy_slab_node() and zonelist_node_idx() may be absent because they are tail calls.
What can be done if the fix cannot be applied immediately?
Avoid concurrent memory offlining that rebuilds zonelists while affected tasks perform strict-NUMA slab allocations under bind or preferred-many policies. In particular, avoid offlining the last block of a zone in the described allocation scenario.