HIGH
mm/slab NMI Race
CVE-2026-46029
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI5.6MEDIUM
01Description
In the Linux kernel, the following vulnerability has been resolved: mm/slab: return NULL early from kmalloc_nolock() in NMI on UP On UP kernels (!CONFIG_SMP), spin_trylock() is a no-op that unconditionally succeeds even when the lock is already held. As a result, kmalloc_nolock() called from NMI context can re-enter the slab allocator and acquire n->list_lock that the interrupted context is already holding, corrupting slab state. With CONFIG_DEBUG_SPINLOCK on UP, the following BUG is triggered with the slub_kunit test module: BUG: spinlock trylock failure on UP on CPU#0, kunit_try_catch/243 [...] Call Trace: <NMI> dump_stack_lvl+0x3f/0x60 do_raw_spin_trylock+0x41/0x50 _raw_spin_trylock+0x24/0x50 get_from_partial_node+0x120/0x4d0 ___slab_alloc+0x8a/0x4c0 kmalloc_nolock_noprof+0x164/0x310 [...] </NMI> Fix this by returning NULL early when invoked from NMI on a UP kernel.
02KernelScan AI Analysis
Risk summary
On UP kernels, NMI context can re-enter the slab allocator and corrupt memory management state, potentially leading to kernel crashes or memory corruption. This affects systems running uniprocessor kernel configurations where NMI handlers or interrupt-context code performs memory allocation.
Vulnerability analysis
The root cause is that on UP kernels, spin_trylock() is implemented as a no-op that always succeeds, breaking the lock semantics that kmalloc_nolock() relies on. When called from NMI context, kmalloc_nolock() can re-enter the slab allocator while the interrupted context already holds n->list_lock, corrupting slab state. The fix prevents this reentrancy by returning NULL early when invoked from NMI on UP kernels. Attack surface is limited to systems with UP kernel configuration and code paths that can trigger NMI-context allocations.
03Fix Versions
| Branch | Fixed in | Patch commit |
|---|---|---|
| 6.18 | 6.18.27 | a8d95d274be2 |
| 7.0 | 7.0.4 | d66553204a15 |
| mainline | 7.1-rc2 | 5b31044e649e |