{"api_version":"1","generated_at":"2026-12-03T05:54:42+00:00","cve":"CVE-2026-142845","urls":{"html":"https://cve.report/CVE-2026-142845","api":"https://cve.report/api/cve/CVE-2026-142845.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-142845","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-142845"},"summary":{"title":"mm/list_lru: don't copy stale shrinker id from non-memcg-aware shrinkers","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/list_lru: don't copy stale shrinker id from non-memcg-aware shrinkers\n\nWith cgroup.memory=nokmem, shrinker_memcg_alloc() fails with -ENOSYS for\nshrinkers without SHRINKER_NONSLAB, and shrinker_alloc() falls back to a\nnon-memcg-aware shrinker.  On this fallback path, shrinker->id is never\nassigned and keeps 0 from kzalloc(), which is a valid id belonging to\nwhichever memcg-aware shrinker registers first.\n\n__list_lru_init() copies shrinker->id unconditionally, so every list_lru\nbacked by such a fallback shrinker (thp-deferred_split, zswap-shrinker,\nworkingset shadow nodes, superblock lrus, ...) ends up with\nlru->shrinker_id == 0 instead of -1.\n\nUnder nokmem the list_lru collapses to the shared per-node lists, but\n__list_lru_add() still calls set_shrinker_bit() against the memcg of\nthe added object.  Most list_lru users are unaffected because their\nobjects resolve to a NULL memcg without kmem accounting, but the THP\ndeferred split queue holds user folios, which are charged regardless of\nnokmem.  On a system where no SHRINKER_NONSLAB shrinker registers,\nshrinker_nr_max stays 0 and every memcg's shrinker_info has map_nr_max\n== 0, so the first folio added by khugepaged triggers on every boot:\n\n  WARNING: mm/shrinker.c:212 at set_shrinker_bit+0x99/0xa0\n\nOn systems where a SHRINKER_NONSLAB shrinker (btrfs, xfs) did register and\nexpand the maps, there is no warning; instead bit 0 is set spuriously for\nan unrelated shrinker.\n\nshrinker->id is only meaningful while SHRINKER_MEMCG_AWARE is set, and all\nreaders inside mm/shrinker.c already check the flag before using the id. \nMake __list_lru_init() do the same and fall back to -1, so\nset_shrinker_bit() is never reached with a bogus id.  The stale\nshrinker->id itself is left as is; cleaning that up is a separate topic.\n\nVerified on a machine booting with cgroup.memory=nokmem and\nCONFIG_TRANSPARENT_HUGEPAGE=y: the warning fires once per boot from\nkhugepaged, disappears when nokmem is removed from the command line, and\nno longer triggers with this fix applied and nokmem set.","state":"PUBLISHED","assigner":"Linux","published_at":"2026-12-03 04:18:21","updated_at":"2026-12-03 04:18:21"},"problem_types":[],"metrics":[],"references":[{"url":"https://git.kernel.org/stable/c/83584cc1f14d9102b612529fd26182f050f2cfad","name":"https://git.kernel.org/stable/c/83584cc1f14d9102b612529fd26182f050f2cfad","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/6a100811c7c5fa39d452ff2e380bd14efbc0208e","name":"https://git.kernel.org/stable/c/6a100811c7c5fa39d452ff2e380bd14efbc0208e","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-142845","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-142845","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected fafaeceb89a5e2e856ff04c2cacb6cae4a2ecb67 83584cc1f14d9102b612529fd26182f050f2cfad git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected fafaeceb89a5e2e856ff04c2cacb6cae4a2ecb67 6a100811c7c5fa39d452ff2e380bd14efbc0208e git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 7.2","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.2 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.3.4 7.3.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.4-rc1 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["mm/list_lru.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"83584cc1f14d9102b612529fd26182f050f2cfad","status":"affected","version":"fafaeceb89a5e2e856ff04c2cacb6cae4a2ecb67","versionType":"git"},{"lessThan":"6a100811c7c5fa39d452ff2e380bd14efbc0208e","status":"affected","version":"fafaeceb89a5e2e856ff04c2cacb6cae4a2ecb67","versionType":"git"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["mm/list_lru.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"7.2"},{"lessThan":"7.2","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"7.3.*","status":"unaffected","version":"7.3.4","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.4-rc1","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.3.4","versionStartIncluding":"7.2","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.4-rc1","versionStartIncluding":"7.2","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/list_lru: don't copy stale shrinker id from non-memcg-aware shrinkers\n\nWith cgroup.memory=nokmem, shrinker_memcg_alloc() fails with -ENOSYS for\nshrinkers without SHRINKER_NONSLAB, and shrinker_alloc() falls back to a\nnon-memcg-aware shrinker.  On this fallback path, shrinker->id is never\nassigned and keeps 0 from kzalloc(), which is a valid id belonging to\nwhichever memcg-aware shrinker registers first.\n\n__list_lru_init() copies shrinker->id unconditionally, so every list_lru\nbacked by such a fallback shrinker (thp-deferred_split, zswap-shrinker,\nworkingset shadow nodes, superblock lrus, ...) ends up with\nlru->shrinker_id == 0 instead of -1.\n\nUnder nokmem the list_lru collapses to the shared per-node lists, but\n__list_lru_add() still calls set_shrinker_bit() against the memcg of\nthe added object.  Most list_lru users are unaffected because their\nobjects resolve to a NULL memcg without kmem accounting, but the THP\ndeferred split queue holds user folios, which are charged regardless of\nnokmem.  On a system where no SHRINKER_NONSLAB shrinker registers,\nshrinker_nr_max stays 0 and every memcg's shrinker_info has map_nr_max\n== 0, so the first folio added by khugepaged triggers on every boot:\n\n  WARNING: mm/shrinker.c:212 at set_shrinker_bit+0x99/0xa0\n\nOn systems where a SHRINKER_NONSLAB shrinker (btrfs, xfs) did register and\nexpand the maps, there is no warning; instead bit 0 is set spuriously for\nan unrelated shrinker.\n\nshrinker->id is only meaningful while SHRINKER_MEMCG_AWARE is set, and all\nreaders inside mm/shrinker.c already check the flag before using the id. \nMake __list_lru_init() do the same and fall back to -1, so\nset_shrinker_bit() is never reached with a bogus id.  The stale\nshrinker->id itself is left as is; cleaning that up is a separate topic.\n\nVerified on a machine booting with cgroup.memory=nokmem and\nCONFIG_TRANSPARENT_HUGEPAGE=y: the warning fires once per boot from\nkhugepaged, disappears when nokmem is removed from the command line, and\nno longer triggers with this fix applied and nokmem set."}],"providerMetadata":{"dateUpdated":"2026-12-03T03:20:54.772Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/83584cc1f14d9102b612529fd26182f050f2cfad"},{"url":"https://git.kernel.org/stable/c/6a100811c7c5fa39d452ff2e380bd14efbc0208e"}],"title":"mm/list_lru: don't copy stale shrinker id from non-memcg-aware shrinkers","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-142845","datePublished":"2026-12-03T03:20:54.772Z","dateReserved":"2026-12-03T03:10:28.332Z","dateUpdated":"2026-12-03T03:20:54.772Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-12-03 04:18:21","lastModifiedDate":"2026-12-03 04:18:21","problem_types":[],"metrics":[],"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"142845","Ordinal":"1","Title":"mm/list_lru: don't copy stale shrinker id from non-memcg-aware s","CVE":"CVE-2026-142845","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"142845","Ordinal":"1","NoteData":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/list_lru: don't copy stale shrinker id from non-memcg-aware shrinkers\n\nWith cgroup.memory=nokmem, shrinker_memcg_alloc() fails with -ENOSYS for\nshrinkers without SHRINKER_NONSLAB, and shrinker_alloc() falls back to a\nnon-memcg-aware shrinker.  On this fallback path, shrinker->id is never\nassigned and keeps 0 from kzalloc(), which is a valid id belonging to\nwhichever memcg-aware shrinker registers first.\n\n__list_lru_init() copies shrinker->id unconditionally, so every list_lru\nbacked by such a fallback shrinker (thp-deferred_split, zswap-shrinker,\nworkingset shadow nodes, superblock lrus, ...) ends up with\nlru->shrinker_id == 0 instead of -1.\n\nUnder nokmem the list_lru collapses to the shared per-node lists, but\n__list_lru_add() still calls set_shrinker_bit() against the memcg of\nthe added object.  Most list_lru users are unaffected because their\nobjects resolve to a NULL memcg without kmem accounting, but the THP\ndeferred split queue holds user folios, which are charged regardless of\nnokmem.  On a system where no SHRINKER_NONSLAB shrinker registers,\nshrinker_nr_max stays 0 and every memcg's shrinker_info has map_nr_max\n== 0, so the first folio added by khugepaged triggers on every boot:\n\n  WARNING: mm/shrinker.c:212 at set_shrinker_bit+0x99/0xa0\n\nOn systems where a SHRINKER_NONSLAB shrinker (btrfs, xfs) did register and\nexpand the maps, there is no warning; instead bit 0 is set spuriously for\nan unrelated shrinker.\n\nshrinker->id is only meaningful while SHRINKER_MEMCG_AWARE is set, and all\nreaders inside mm/shrinker.c already check the flag before using the id. \nMake __list_lru_init() do the same and fall back to -1, so\nset_shrinker_bit() is never reached with a bogus id.  The stale\nshrinker->id itself is left as is; cleaning that up is a separate topic.\n\nVerified on a machine booting with cgroup.memory=nokmem and\nCONFIG_TRANSPARENT_HUGEPAGE=y: the warning fires once per boot from\nkhugepaged, disappears when nokmem is removed from the command line, and\nno longer triggers with this fix applied and nokmem set.","Type":"Description","Title":"mm/list_lru: don't copy stale shrinker id from non-memcg-aware s"}]}}}