{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2024-35993",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2024-35993"
  ],
  "published": "2024-05-20T09:48:48Z",
  "summary": "mm: turn folio_test_hugetlb into a PageType",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nmm: turn folio_test_hugetlb into a PageType\n\nThe current folio_test_hugetlb() can be fooled by a concurrent folio split\ninto returning true for a folio which has never belonged to hugetlbfs. \nThis can't happen if the caller holds a refcount on it, but we have a few\nplaces (memory-failure, compaction, procfs) which do not and should not\ntake a speculative reference.\n\nSince hugetlb pages do not use individual page mapcounts (they are always\nfully mapped and use the entire_mapcount field to record the number of\nmappings), the PageType field is available now that page_mapcount()\nignores the value in this field.\n\nIn compaction and with CONFIG_DEBUG_VM enabled, the current implementation\ncan result in an oops, as reported by Luis. This happens since 9c5ccf2db04b\n(\"mm: remove HUGETLB_PAGE_DTOR\") effectively added some VM_BUG_ON() checks\nin the PageHuge() testing path.\n\n[willy@infradead.org: update vmcoreinfo]",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
    }
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:12",
        "name": "linux"
      },
      "versions": [
        "1:6.6.20-1+rpt1",
        "1:6.6.28-1+rpt1"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.6.20+rpt-rpi-2712",
            "binary_version": "1:6.6.20-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.6.20+rpt-rpi-v6",
            "binary_version": "1:6.6.20-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.6.20+rpt-rpi-v7",
            "binary_version": "1:6.6.20-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.6.20+rpt-rpi-v7l",
            "binary_version": "1:6.6.20-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.6.20+rpt-rpi-v8",
            "binary_version": "1:6.6.20-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.6.28+rpt-rpi-2712",
            "binary_version": "1:6.6.28-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.6.28+rpt-rpi-v6",
            "binary_version": "1:6.6.28-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.6.28+rpt-rpi-v7",
            "binary_version": "1:6.6.28-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.6.28+rpt-rpi-v7l",
            "binary_version": "1:6.6.28-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.6.28+rpt-rpi-v8",
            "binary_version": "1:6.6.28-1+rpt1"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.6.20-1+rpt1": {
            "linux_commit": "6f16847710cc0502450788b9f12f0a14d3429668",
            "upstream_version": "6.6.20",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.6.30"
          },
          "1:6.6.28-1+rpt1": {
            "linux_commit": "0c341f47adc3578cd5f817aa20ee2b7f9ae6b23e",
            "upstream_version": "6.6.28",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.6.30"
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2024-35993"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/2431b5f2650dfc47ce782d1ca7b02d6b3916976f"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/9fdcc5b6359dfdaa52a55033bf50e2cedd66eb32"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/d99e3140a4d33e26066183ff727d8f02f56bec64"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T11:52:36Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 7.8,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - The vulnerability is in core MM page-flag accessors reached via compaction, memory-failure and procfs; triggering it requires local execution to allocate/split THPs and drive compaction scans. There is no remote or adjacent-network path to this code.\nAC:L - This is a race the attacker creates on both sides \u2014 one set of threads forces THP splits via madvise(MADV_DONTNEED)/partial munmap while another drives compaction (memory pressure, THP faults, or CMA/dma-buf allocations), and compaction scans millions of PFNs per second, so the narrow window between the two loads is retried continuously at no cost.\nPR:L - Only an ordinary unprivileged local user is needed: THP allocation and splitting are unprivileged operations, and direct compaction plus alloc_contig_range (CMA/dma-buf heap, v4l2 videobuf2) are reachable from normal userspace on Android and embedded systems without any capability.\nUI:N - The attacker's own threads generate both the folio split and the compaction scan; no victim action or cooperation is required.\nS:U - The type confusion and resulting corruption stay within the kernel's own security authority; no VM, IOMMU or sandbox boundary is crossed.\nC:H - folio_test_hugetlb() misidentifies a THP as a hugetlb folio, causing the kernel to read and interpret THP tail-page fields (_flags_1/_flags_2, _hugetlb_subpool, _hugetlb_hwpoison) as hugetlb metadata; this type confusion and the resulting list/metadata corruption are leverageable for disclosure of kernel memory contents.\nI:H - Type confusion leads to hugetlb machinery mutating non-hugetlb state \u2014 isolate_hugetlb() performs list_move_tail() on a THP still on an LRU list and clears bits in folio->private, and folio_set_hugetlb_hwpoison() does llist_add() into fields overlapping a THP's _deferred_list, giving linked-list corruption and a write primitive.\nA:H - isolate_or_dissolve_huge_page() dereferences the NULL hstate returned by size_to_hstate() in hstate_is_gigantic() (h->order), producing a kernel oops, and with CONFIG_DEBUG_VM_PGFLAGS the VM_BUG_ON_PGFLAGS in folio_flags() panics the kernel \u2014 the originally reported symptom."
    }
  }
}
