{"id":"CVE-2024-35846","summary":"mm: zswap: fix shrinker NULL crash with cgroup_disable=memory","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm: zswap: fix shrinker NULL crash with cgroup_disable=memory\n\nChristian reports a NULL deref in zswap that he bisected down to the zswap\nshrinker.  The issue also cropped up in the bug trackers of libguestfs [1]\nand the Red Hat bugzilla [2].\n\nThe problem is that when memcg is disabled with the boot time flag, the\nzswap shrinker might get called with sc-\u003ememcg == NULL.  This is okay in\nmany places, like the lruvec operations.  But it crashes in\nmemcg_page_state() - which is only used due to the non-node accounting of\ncgroup's the zswap memory to begin with.\n\nNhat spotted that the memcg can be NULL in the memcg-disabled case, and I\nwas then able to reproduce the crash locally as well.\n\n[1] https://github.com/libguestfs/libguestfs/issues/139\n[2] https://bugzilla.redhat.com/show_bug.cgi?id=2275252","modified":"2026-03-20T12:36:41.237667Z","published":"2024-05-17T14:47:25.503Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/35xxx/CVE-2024-35846.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/682886ec69d22363819a83ddddd5d66cb5c791e1"},{"type":"WEB","url":"https://git.kernel.org/stable/c/b0fdabc908a7f81d12382c87ca9e46a9c2e14042"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/35xxx/CVE-2024-35846.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-35846"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"b5ba474f3f518701249598b35c581b92a3c95b48"},{"fixed":"b0fdabc908a7f81d12382c87ca9e46a9c2e14042"},{"fixed":"682886ec69d22363819a83ddddd5d66cb5c791e1"}]}],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-35846.json"}}],"schema_version":"1.7.5"}