Skip to content
Heist/ feed
Back to feed
UnratedFix available

mm: zswap: fix shrinker NULL crash with cgroup_disable=memory

Type: advisorySources: OSV

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

Products
Kernel
Affected versions
Not specified
Fixed versions
6.8.9
CVEs
CVE-2024-35846
Confirmed fixed CVEs
Not specified
Updated in this feed
2 Nov 2026, 23:18 UTC · Revision 1

Source evidence

mm: zswap: fix shrinker NULL crash with cgroup_disable=memory

core-osv · Original source

Published 17 May 2024, 14:47 UTC

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

osv:CVE-2024-35846

Kernel

Fixed versions: 6.8.9

Complete source record
{
  "id": "4d769bfb89fd8a885f6b3f85102b301b9466c9889f8d3d30bbe3fe5ee7621ece",
  "url": "https://osv.dev/vulnerability/CVE-2024-35846",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "mm: zswap: fix shrinker NULL crash with cgroup_disable=memory",
    "summary": "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",
    "evidence": "osv:CVE-2024-35846",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "6.8.9",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "CVE-2024-35846",
      "aliases": [
        "CVE-2024-35846"
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "b5ba474f3f518701249598b35c581b92a3c95b48"
                },
                {
                  "fixed": "b0fdabc908a7f81d12382c87ca9e46a9c2e14042"
                },
                {
                  "fixed": "682886ec69d22363819a83ddddd5d66cb5c791e1"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-35846.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.8.0"
                },
                {
                  "fixed": "6.8.9"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-35846.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:24.726331145Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/682886ec69d22363819a83ddddd5d66cb5c791e1",
        "https://git.kernel.org/stable/c/b0fdabc908a7f81d12382c87ca9e46a9c2e14042",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/35xxx/CVE-2024-35846.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2024-35846",
        "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
      ],
      "provider_metadata": {
        "cna_assigner": "Linux",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/35xxx/CVE-2024-35846.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2024-35846",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 490824,
  "published_at": "2024-05-17T14:47:25.503+00:00"
}