CVE-2026-142845: mm/list_lru: don't copy stale shrinker id from non-memcg-aware shrinkers

Published Dec 3, 2026
·
Updated

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

mm/listlru: don't copy stale shrinker id from non-memcg-aware shrinkers

With cgroup.memory=nokmem, shrinkermemcgalloc() fails with -ENOSYS for shrinkers without SHRINKERNONSLAB, and shrinkeralloc() falls back to a non-memcg-aware shrinker. On this fallback path, shrinker->id is never assigned and keeps 0 from kzalloc(), which is a valid id belonging to whichever memcg-aware shrinker registers first.

listlruinit() copies shrinker->id unconditionally, so every listlru backed by such a fallback shrinker (thp-deferredsplit, zswap-shrinker, workingset shadow nodes, superblock lrus, ...) ends up with lru->shrinkerid == 0 instead of -1.

Under nokmem the listlru collapses to the shared per-node lists, but listlruadd() still calls setshrinkerbit() against the memcg of the added object. Most listlru users are unaffected because their objects resolve to a NULL memcg without kmem accounting, but the THP deferred split queue holds user folios, which are charged regardless of nokmem. On a system where no SHRINKERNONSLAB shrinker registers, shrinkernrmax stays 0 and every memcg's shrinkerinfo has mapnrmax == 0, so the first folio added by khugepaged triggers on every boot:

WARNING: mm/shrinker.c:212 at setshrinkerbit+0x99/0xa0

On systems where a SHRINKERNONSLAB shrinker (btrfs, xfs) did register and expand the maps, there is no warning; instead bit 0 is set spuriously for an unrelated shrinker.

shrinker->id is only meaningful while SHRINKERMEMCGAWARE is set, and all readers inside mm/shrinker.c already check the flag before using the id. Make listlruinit() do the same and fall back to -1, so setshrinkerbit() is never reached with a bogus id. The stale shrinker->id itself is left as is; cleaning that up is a separate topic.

Verified on a machine booting with cgroup.memory=nokmem and CONFIGTRANSPARENTHUGEPAGE=y: the warning fires once per boot from khugepaged, disappears when nokmem is removed from the command line, and no longer triggers with this fix applied and nokmem set.

Affected Software

1 affected component
Linux Linux kernel

Event History

Dec 3, 2026
CVE Published
via MITRE·03:20 AM
Data Sourced
via MITRE·03:20 AM
Description

Frequently Asked Questions

1

Which configurations can encounter this condition?

It requires cgroup.memory=nokmem and a shrinker for which shrinker_memcg_alloc() fails with -ENOSYS, causing shrinker_alloc() to fall back to a non-memcg-aware shrinker. The fallback shrinker retains an unassigned ID of 0.

2

Which list_lru users are most relevant?

Most list_lru users are unaffected because their objects resolve to a NULL memcg when kmem accounting is disabled. The THP deferred split queue is notable because it contains user folios that remain charged even with nokmem; other affected list_lru-backed users can include zswap, workingset shadow nodes, and superblock LRUs.

3

What registration state makes the stale ID especially problematic?

If no SHRINKER_NONSLAB shrinker registers, shrinker_nr_max remains 0 and the stale value 0 can correspond to the first memcg-aware shrinker. The fallback list_lru instances then use shrinker_id 0 rather than the expected -1.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203