CVE-2026-99910: mm: multi-gen LRU: fix NULL lruvec->pgdat deref with memcg disabled on cmdline
In the Linux kernel, the following vulnerability has been resolved:
mm: multi-gen LRU: fix NULL lruvec->pgdat deref with memcg disabled on cmdline
When CONFIGMEMCG=y, lruvecpgdat() returns lruvec->pgdat, which for the per-node pgdat->lruvec is left NULL by lruvecinit() and only filled in lazily by memcgrouplruvec(). Normally that happens early, e.g. on the first folioaddlru().
With cgroupdisable=memory, lrugenshrinknode() passes &pgdat->lruvec directly to shrinkone(). If direct reclaim runs before anything has called memcgrouplruvec() for the node, which can happen during early boot under memory pressure (e.g. a kdump kernel), getswappiness() ends up dereferencing a NULL pgdat:
Unable to handle kernel NULL pointer dereference at virtual address 0000000000005040 pc : getswappiness+0x68/0xb0 lr : trytoshrinklruvec+0x54/0x2c0 Call trace: getswappiness+0x68/0xb0 (P) trytoshrinklruvec+0x54/0x2c0 shrinkone+0x8c/0x240 shrinknode+0xc6c/0xe08 dotrytofreepages+0xdc/0x570 trytofreepages+0x124/0x278 allocfrozenpagesnoprof+0x6e8/0xf78 allocpagesmpol+0xc4/0x1c0 allocfrozenpagesnoprof+0x54/0xe8 allocpagesnoprof+0x1c/0x40 atomicpoolexpand+0x98/0x300 dmaatomicpoolinit+0x58/0xd8 dmaatomicpoolinit+0x154/0x170 dooneinitcall+0x64/0x350 kernelinitfreeable+0x214/0x430 kernelinit+0x2c/0x208 retfromfork+0x10/0x20
The classic LRU path and MGLRU before per-node lrugenfolio lists obtained the lruvec through memcgrouplruvec(), which sets lruvec->pgdat.
The above was hit on an arm64 kdump kernel (6.18-based) booted with cgroupdisable=memory nrcpus=4. It also reproduces on mainline on an arm64 VM with CONFIGARM6464KPAGES=y, CONFIGMEMCG=y, CONFIGLRUGENENABLED=y and:
mem=160M nrcpus=4 coherentpool=512M cgroupdisable=memory
These options only serve to force direct reclaim early in boot; with 160M the boot eventually ends in OOM regardless. On mainline the first LRU reclaim happens while unpacking the initramfs, and faults the same way:
Unable to handle kernel NULL pointer dereference at virtual address 0000000000005040 pc : getswappiness+0xd4/0x150 Call trace: getswappiness+0xd4/0x150 (P) trytoshrinklruvec+0x44/0x2b8 shrinkone+0x80/0x1a0 shrinknode+0xd98/0xea8 dotrytofreepages+0xf4/0x4b0 trytofreepages+0x110/0x360 allocfrozenpagesnoprof+0x8b0/0x1718 ... filemapgetfoliompol+0x2ac/0x548 simplewritebegin+0x44/0xf8 pagesymlink+0x178/0x198 ... dopopulaterootfs+0x13c/0x200
Affected Software
Event History
Frequently Asked Questions
Which systems are exposed to this failure?
Systems built with CONFIG_MEMCG=y that boot with cgroup_disable=memory are affected when multi-gen LRU reclaim uses a per-node lruvec whose pgdat pointer has not yet been initialized. The described scenario is most likely during early boot under memory pressure, including in a kdump kernel.
What conditions trigger the crash?
Direct memory reclaim must run before any operation has initialized the node's lruvec through mem_cgroup_lruvec(). Reclaim then reaches get_swappiness(), which dereferences the NULL pgdat pointer.
How can I recognize this issue in logs or crash output?
Look for a kernel NULL pointer dereference at virtual address 0000000000005040 with get_swappiness in the trace. The reported call chain includes try_to_shrink_lruvec, shrink_one, shrink_node, and try_to_free_pages.