{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-99580","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2026-09-25T10:25:14.423Z","datePublished":"2026-11-20T05:49:12.114Z","dateUpdated":"2026-11-22T11:09:02.427Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-11-22T11:09:02.427Z"},"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/userfaultfd: only allocate anon_vma in CoW mappings\n\nfind_vma_and_prepare_anon() can end up allocating an anon_vma in VMAs that\nare not CoW mappings, which is wrong.\n\nIf we have a MAP_SHARED R/O file mapped, we lack VM_SHARED (but do have\nVM_MAYSHARE) and lack VM_MAYWRITE.\n\nWhile uffd later rejects such mappings (uffd registration requires\nVM_MAYWRITE, see comment in validate_dst_vma) find_vma_and_prepare_anon()\nstill wrongly allocates an anon vma before it validates the vma.\n\nThis in turn later confuses copy_page_range()->vma_needs_copy() such\nthat we end up calling copy_hugetlb_page_range() with ranges that\nactually do not contain *any* per-pagetable information that would\nrequire copying, which is the basis for PMD-table sharing in the first\nplace.\n\ncopy_hugetlb_page_range() should not have to worry about shared\nPMD tables at all: it doesn't make any sense to copy page tables that are\nshared, as they can be fully recreated later. Ending up in the function\nwith shareable page tables is the real issue.\n\nIf a destination PMD table is shared in copy_hugetlb_page_range(), it\nmight get concurrently unshared as we are not holding relevant\nlocks, resulting in us using a page table that is no longer mapped and\npossibly freed after calling:\n\n\tdst_pte = huge_pte_alloc(dst, dst_vma, addr, sz);\n\nTo fix it, do not allocate an anon_vma in non-CoW mappings and add a\nsafety guard to copy_hugetlb_page_range(), making sure that we never\nend up messing with shared PMD tables in there.\n\nBefore commit 867a43a34ff8a (\"userfaultfd: use per-vma locks in userfaultfd\noperations\") we would always validate the VMA before allocating an\nanon_vma, and consequently never wrongly allocate an anon_vma.\n\nAs uffd_lock_vma() is part of the same lookup machinery and\nalso contains a misleading VM_SHARED check, change that one as well\ndirectly for consistency.\n\nA follow-up cleanup will stop taking the hugetlb_vma_lock_read(src_vma)\nlock in copy_hugetlb_page_range() entirely. Further, the usage of\nVM_SHARED in userfaultfd code should be cleaned up later to focus on\nCoW vs. non-CoW mappings."}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - UFFDIO_ZEROPAGE reaches find_vma_and_prepare_anon() through userfaultfd_ioctl(), userfaultfd_zeropage(), mfill_atomic(), and uffd_mfill_lock() on the caller's mm. mmap() of an O_RDONLY hugetlb file clears VM_SHARED and VM_MAYWRITE in mm/mmap.c while leaving VM_MAYSHARE; no received packet supplies that VMA.\nAC:L - The attacker reopens the hugetlb fd O_RDONLY, faults a PUD-spanning MAP_SHARED|MAP_NORESERVE VMA so huge_pmd_share() can attach a PMD, then races fork() with another of their processes' munmap(). dup_mmap() holds the forking mm's mmap_lock and hugetlb_vma_lock_read(src_vma); the other process's huge_pmd_unshare() takes the inode i_mmap write lock, which huge_pmd_share() has already dropped.\nPR:L - find_vma_and_prepare_anon() calls anon_vma_prepare() before validate_dst_vma() sees that the VMA has no uffd context. userfaultfd_syscall_allowed() accepts UFFD_USER_MODE_ONLY with no CAP_SYS_PTRACE, and hugetlb_file_setup(HUGETLB_ANONHUGE_INODE) does not call can_do_hugetlb_shm().\nUI:N - The attacker mmaps its own O_RDONLY hugetlb VMA, calls UFFDIO_ZEROPAGE so anon_vma_prepare() runs before validate_dst_vma() rejects it, then forks while its other process unmaps the sharer. No other user mounts or opens the file.\nS:U - set_huge_pte_at() in copy_hugetlb_page_range() corrupts a page-table page in the forking host's kernel. The result stays in that kernel security authority.\nC:H - vma_needs_copy() follows the stray anon_vma into copy_hugetlb_page_range(). After huge_pmd_unshare() pud_clears the shared PMD, the last mapper's free_pmd_range() frees it via pmd_free_tlb() and ___pmd_free_tlb(), and the copy still reads ptdesc->pt_share_count and huge_ptep_get(dst_pte) on the reused page.\nI:H - huge_pte_lock() takes the split PMD ptl inside that freed page, and set_huge_pte_at() stores the source huge PTE through the same dst_pte. Reclaiming the page as a page table or a slab object turns those stores into a kernel write.\nA:H - huge_pte_lock() and set_huge_pte_at() run after ___pmd_free_tlb() has returned the PMD page to the allocator. Locking a reused spinlock or writing a recycled page table oopses or hangs the kernel, and the attacker can repeat the fork against a new sharer."}]}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/hugetlb.c","mm/userfaultfd.c"],"versions":[{"version":"867a43a34ff8a38772212045262b2c9b77807ea3","lessThan":"a90e7044b34f801fbafcb682e8ee827a6db26002","status":"affected","versionType":"git"},{"version":"867a43a34ff8a38772212045262b2c9b77807ea3","lessThan":"3bf446c8ce64938f86439906d730a2cd5c0b31e2","status":"affected","versionType":"git"},{"version":"867a43a34ff8a38772212045262b2c9b77807ea3","lessThan":"20704188d669ed74a624fd67dfa4711bcb1087b6","status":"affected","versionType":"git"},{"version":"867a43a34ff8a38772212045262b2c9b77807ea3","lessThan":"514c9247db305922591d806ec65d3c3fe420538d","status":"affected","versionType":"git"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/hugetlb.c","mm/userfaultfd.c"],"versions":[{"version":"6.9","status":"affected"},{"version":"0","lessThan":"6.9","status":"unaffected","versionType":"semver"},{"version":"6.12.118","lessThanOrEqual":"6.12.*","status":"unaffected","versionType":"semver"},{"version":"6.18.64","lessThanOrEqual":"6.18.*","status":"unaffected","versionType":"semver"},{"version":"7.3.5","lessThanOrEqual":"7.3.*","status":"unaffected","versionType":"semver"},{"version":"7.4-rc1","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.9","versionEndExcluding":"6.12.118"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.9","versionEndExcluding":"6.18.64"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.9","versionEndExcluding":"7.3.5"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.9","versionEndExcluding":"7.4-rc1"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/a90e7044b34f801fbafcb682e8ee827a6db26002"},{"url":"https://git.kernel.org/stable/c/3bf446c8ce64938f86439906d730a2cd5c0b31e2"},{"url":"https://git.kernel.org/stable/c/20704188d669ed74a624fd67dfa4711bcb1087b6"},{"url":"https://git.kernel.org/stable/c/514c9247db305922591d806ec65d3c3fe420538d"}],"title":"mm/userfaultfd: only allocate anon_vma in CoW mappings","x_generator":{"engine":"bippy-1.2.0"}}}}