{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2026-99507",
  "modified": "2026-11-24T05:30:02Z",
  "upstream": [
    "CVE-2026-99507"
  ],
  "published": "2026-11-19T15:08:37Z",
  "summary": "mm/hugetlb: fix use-after-free in hugetlb_mfill_atomic_pte()",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nmm/hugetlb: fix use-after-free in hugetlb_mfill_atomic_pte()\n\nLet's fix another instance where we use a folio after dropping the PTL,\nwhere someone else could e.g., MADV_DONTNEED it once we drop the PTL,\nmaking us trigger a use-after-free on the folio.",
  "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.1.47-1+rpt4"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-2712",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v6",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7l",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v8",
            "binary_version": "1:6.1.47-1+rpt4"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.1.47-1+rpt4": {
            "linux_commit": "655fc658a15ae7a6f37103754adb39ba52a9a14e",
            "upstream_version": "6.1.47",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.1.193",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2026-99507"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/3e0da2f9f19e28d6bc1afc5090a089c125db5d73"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/b4669d77bf9cab09a96dcacda4b20ffe727bc9f6"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/dc9426dfa7fdaf9b00f5c5342f95e708b3567b31"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/fd16432642b3e206a73e95ccd043dc686844fc0f"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/cda6c4819b4a45dbeac92652eaaffb156b3f11b1"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/8b87fd23be5a816ad572e23eb4e1e2bea027db6c"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/83798e46a01c3139273cddcc634e96dfee980c42"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/d8a9cd7fd2fb01211430c933932da58839b8ca65"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-11-23T08:12:11Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 7.8,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - UFFDIO_COPY reaches hugetlb_mfill_atomic_pte() via userfaultfd_copy(), mfill_atomic_copy(), and mfill_atomic_hugetlb(); the folio used after spin_unlock(ptl) is the private huge page that ioctl installed, not a field taken from a received packet.\nAC:L - The caller races UFFDIO_COPY with MADV_DONTNEED on a MAP_PRIVATE|MAP_NORESERVE hugetlb VMA, or in the child after fork(), where __vma_private_lock() is false. hugetlb_vma_lock_read() is then a no-op, so hugetlb_unmap_range() can folio_put the PTE's only reference before folio_set_hugetlb_migratable().\nPR:L - userfaultfd_syscall_allowed() accepts UFFD_USER_MODE_ONLY with no CAP_SYS_PTRACE, and ksys_mmap_pgoff() creates an anonymous MAP_HUGETLB file in hugetlb_file_setup() without can_do_hugetlb_shm(); UFFDIO_REGISTER only checks VM_MAYWRITE on that VMA.\nUI:N - The attacker mmaps the hugetlb range, registers userfaultfd, and races UFFDIO_COPY with MADV_DONTNEED in its own threads. No other task has to mount, open, or fault the mapping.\nS:U - folio_set_hugetlb_migratable() corrupts the folio free_huge_folio() already released from the caller's PTE. The result stays in that host's kernel address space, with no guest-to-host or IOMMU boundary crossed.\nC:H - MADV_DONTNEED's folio_put() in free_pages_and_swap_cache() calls free_huge_folio() on the PTE's only reference. A surplus page is then passed to free_frozen_pages(), whose set_buddy_order() stores the order in page->private, and the late set_bit(HPG_migratable) corrupts that reused struct page.\nI:H - folio_set_hugetlb_migratable() is set_bit(HPG_migratable, &folio->private) after the page-table reference is gone. On the hugepage freelist the next dequeue inherits the flag; if surplus_huge_pages_node[nid] is set, the same bit flips the buddy order written by set_buddy_order().\nA:H - hugetlb_unmap_range() drops the last reference and free_huge_folio() recycles the folio while hugetlb_mfill_atomic_pte() still writes it. Flipping the buddy order or a freelist folio's migratable flag faults the page allocator or a later fault on the reused page."
    }
  }
}
