CVE-2024-35846: mm: zswap: fix shrinker NULL crash with cgroup_disable=memory
In the Linux kernel, the following vulnerability has been resolved:
mm: zswap: fix shrinker NULL crash with cgroup_disable=memory
Christian reports a NULL deref in zswap that he bisected down to the zswap
shrinker. The issue also cropped up in the bug trackers of libguestfs [1]
and the Red Hat bugzilla [2].
The problem is that when memcg is disabled with the boot time flag, the
zswap shrinker might get called with sc->memcg == NULL. This is okay in
many places, like the lruvec operations. But it crashes in
memcg_page_state() - which is only used due to the non-node accounting of
cgroup's the zswap memory to begin with.
Nhat spotted that the memcg can be NULL in the memcg-disabled case, and I
was then able to reproduce the crash locally as well.
[1] https://github.com/libguestfs/libguestfs/issues/139
[2] https://bugzilla.redhat.com/show_bug.cgi?id=2275252
Security readout for executives and security teams
Plain-English summary
CVE-2024-35846 is a Linux kernel crash bug in zswap. On systems booted with memory cgroups disabled, the zswap shrinker can hit a NULL pointer and crash the kernel. The provided sources support an availability concern, not data theft or privilege escalation.
Executive priority
Treat this as an availability risk for a narrow Linux configuration. Prioritize production hosts matching the affected kernel and boot setting, especially virtualization, appliance, or infrastructure systems where an unexpected kernel crash creates business disruption.
Technical view
When memcg is disabled using cgroup_disable=memory, the zswap shrinker may run with sc->memcg set to NULL. Code paths using memcg_page_state() did not tolerate that NULL value, causing a NULL dereference. Kernel stable commits are referenced as the resolution.
Likely exposure
Exposure appears limited to affected Linux 6.8-era kernels using zswap with memory cgroups disabled at boot. Confirm actual exposure through kernel version, vendor backports, boot parameters, and zswap status.
Exploitation context
The CVE is not listed as CISA KEV in the provided bundle. Sources describe observed crashes and bug tracker reports, but do not document active exploitation or a weaponized attack path.
Researcher notes
The source evidence is specific: zswap shrinker behavior with memcg disabled. The bundle provides no CVSS, CWE, exploit status, or broad affected-product mapping. Avoid extrapolating beyond Linux kernels and configurations matching the described condition.
Mitigation direction
Apply a vendor kernel update containing the referenced stable fixes.
Confirm whether your distribution backported the fix into its supported kernel.
Review boot parameters for cgroup_disable=memory on affected hosts.
If unpatched, consult vendor guidance before changing zswap or cgroup settings.
Prioritize systems where kernel crashes would affect production availability.
Validation and detection
Inventory Linux hosts running affected 6.8-series kernels.
Check boot configuration for cgroup_disable=memory.
Confirm whether zswap is enabled on those hosts.
Review kernel logs for zswap, shrinker, memcg_page_state, or NULL dereference crashes.
Verify fixed kernel build provenance against vendor advisories or stable commit references.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2024-35846 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.