Skip to main content

CVE-2024-35846: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2024-35846cvecve-2024-35846
Published: Fri May 17 2024 (05/17/2024, 14:47:25 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

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

AI-Powered Analysis

AILast updated: 06/29/2025, 16:28:19 UTC

Technical Analysis

CVE-2024-35846 is a vulnerability identified in the Linux kernel's memory management subsystem, specifically within the zswap component. Zswap is a compressed cache for swap pages that improves system performance by reducing I/O to slower swap devices. The vulnerability arises when the kernel is booted with the 'cgroup_disable=memory' flag, which disables memory control groups (memcg). Under this configuration, the zswap shrinker function may be invoked with a NULL memcg pointer (sc->memcg == NULL). While many parts of the kernel handle a NULL memcg gracefully, the zswap shrinker calls memcg_page_state(), which does not expect a NULL memcg and thus causes a NULL pointer dereference, leading to a kernel crash (NULL dereference). This crash can cause system instability or denial of service. The issue was reported by Christian and further analyzed by Nhat, who reproduced the crash locally. It has been tracked in related projects such as libguestfs and Red Hat's bugzilla, indicating its relevance in virtualization and enterprise Linux distributions. The root cause is the lack of proper NULL checks in the zswap shrinker when memory cgroups are disabled, resulting in an unhandled NULL pointer dereference. No known exploits are currently reported in the wild, and no CVSS score has been assigned yet.

Potential Impact

For European organizations, this vulnerability poses a risk primarily to systems running Linux kernels with zswap enabled and memory cgroups disabled via the boot parameter. The impact is a potential denial of service due to kernel crashes triggered by the NULL pointer dereference. This can affect servers, virtualized environments, and cloud infrastructure relying on Linux, especially those using zswap for performance optimization. Organizations in sectors such as finance, telecommunications, government, and critical infrastructure could face operational disruptions if exploited, leading to downtime and potential loss of availability. Although exploitation requires specific kernel configurations, the widespread use of Linux in Europe means that some systems may be vulnerable, particularly customized or legacy deployments where memory cgroups are disabled. The vulnerability does not appear to allow privilege escalation or data leakage directly but can degrade system reliability and availability, impacting business continuity and service delivery.

Mitigation Recommendations

To mitigate this vulnerability, European organizations should: 1) Apply the latest Linux kernel patches that address CVE-2024-35846 as soon as they become available from their Linux distribution vendors. 2) Audit and review kernel boot parameters to avoid disabling memory cgroups unless absolutely necessary, as this configuration triggers the vulnerability. 3) If disabling memory cgroups is required, consider disabling zswap or recompiling the kernel with the fix applied to prevent the NULL dereference. 4) Implement robust monitoring for kernel crashes and system instability to detect potential exploitation attempts early. 5) In virtualized environments, ensure hypervisors and guest OS images are updated, as libguestfs and Red Hat bug reports indicate relevance in these contexts. 6) Conduct thorough testing of kernel updates in staging environments to confirm stability before production deployment. These steps go beyond generic advice by focusing on configuration review, patch management, and environment-specific considerations.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-05-17T13:50:33.105Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d982ac4522896dcbe3635

Added to database: 5/21/2025, 9:08:58 AM

Last enriched: 6/29/2025, 4:28:19 PM

Last updated: 8/11/2025, 8:53:16 AM

Views: 12

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats