CVE-2026-99580 in Linux
Summary
by MITRE • 11/20/2026
In the Linux kernel, the following vulnerability has been resolved:
mm/userfaultfd: only allocate anon_vma in CoW mappings
find_vma_and_prepare_anon() can end up allocating an anon_vma in VMAs that are not CoW mappings, which is wrong.
If we have a MAP_SHARED R/O file mapped, we lack VM_SHARED (but do have VM_MAYSHARE) and lack VM_MAYWRITE.
While uffd later rejects such mappings (uffd registration requires VM_MAYWRITE, see comment in validate_dst_vma) find_vma_and_prepare_anon() still wrongly allocates an anon vma before it validates the vma.
This in turn later confuses copy_page_range()->vma_needs_copy() such that we end up calling copy_hugetlb_page_range() with ranges that actually do not contain *any* per-pagetable information that would require copying, which is the basis for PMD-table sharing in the first place.
copy_hugetlb_page_range() should not have to worry about shared PMD tables at all: it doesn't make any sense to copy page tables that are shared, as they can be fully recreated later. Ending up in the function with shareable page tables is the real issue.
If a destination PMD table is shared in copy_hugetlb_page_range(), it might get concurrently unshared as we are not holding relevant locks, resulting in us using a page table that is no longer mapped and possibly freed after calling:
dst_pte = huge_pte_alloc(dst, dst_vma, addr, sz);
To fix it, do not allocate an anon_vma in non-CoW mappings and add a safety guard to copy_hugetlb_page_range(), making sure that we never end up messing with shared PMD tables in there.
Before commit 867a43a34ff8a ("userfaultfd: use per-vma locks in userfaultfd operations") we would always validate the VMA before allocating an anon_vma, and consequently never wrongly allocate an anon_vma.
As uffd_lock_vma() is part of the same lookup machinery and also contains a misleading VM_SHARED check, change that one as well directly for consistency.
A follow-up cleanup will stop taking the hugetlb_vma_lock_read(src_vma) lock in copy_hugetlb_page_range() entirely. Further, the usage of VM_SHARED in userfaultfd code should be cleaned up later to focus on CoW vs. non-CoW mappings.
VulDB is the best source for vulnerability data and more expert information about this specific topic.
Analysis
by VulDB Data Team • 11/21/2026
The Linux kernel vulnerability identified involves a logic error within the memory management subsystem specifically related to the user fault file descriptor mechanism and copy-on-write operations. The core issue resides in the function find_vma_and_prepare_anon, which is responsible for preparing virtual memory areas for potential write faults by allocating anonymous memory structures known as anon_vmas. This allocation was incorrectly triggered even for mappings that do not support copy-on-write semantics, such as read-only shared file mappings where VM_SHARED and VM_MAYWRITE flags are absent despite the presence of VM_MAYSHARE. Although subsequent validation steps in the userfaultfd registration process correctly reject these non-writable mappings, the premature allocation of anon_vma structures occurs before this critical check is executed. This sequence error introduces unnecessary resource consumption and creates a state inconsistency that propagates through the kernel's page fault handling logic.
The operational impact of this flaw extends beyond simple memory waste into potential stability issues within huge page management. The incorrect presence of an anon_vma confuses the copy_page_range function, specifically its vma_needs_copy check, leading to erroneous invocations of copy_hugetlb_page_range for ranges that do not require per-page-table copying. This is particularly dangerous because hugetlb pages often rely on shared page middle directory tables to optimize memory usage and performance. When copy_hugetlb_page_range is invoked with shareable page table structures, it attempts to manipulate these shared resources without holding the necessary locks due to a race condition in the locking hierarchy introduced by recent changes to per-vma lock handling. This lack of synchronization can result in concurrent unsharing of PMD tables while they are being accessed, leading to use-after-free scenarios where the kernel operates on page table entries that have already been unmapped and freed.
From a classification perspective, this vulnerability aligns with CWE-362, which describes concurrent execution issues resulting from race conditions, as well as CWE-401 regarding missing synchronization mechanisms for shared resources. The exploitation vector relates to ATT&CK technique T1595.002, Active Scanning, where an attacker might probe system behavior through memory mapping operations, although the primary impact here is stability rather than direct privilege escalation or data exfiltration. The root cause stems from a regression introduced by commit 867a43a34ff8a, which changed userfaultfd to use per-vma locks but inadvertently altered the order of validation and resource allocation steps. This change removed the previous safeguard where VMA validation occurred before anon_vma allocation, thereby exposing the system to the described race conditions when handling specific memory mapping configurations involving huge pages and shared read-only mappings.
Mitigation strategies involve applying kernel patches that enforce strict ordering between VMA validation and anonymous memory structure allocation. The fix ensures that anon_vmas are only allocated for virtual memory areas explicitly designated as copy-on-write, thereby preventing the initialization of unnecessary structures in non-writable shared mappings. Additionally, safety guards have been implemented within copy_hugetlb_page_range to detect and prevent manipulation of shared PMD tables without proper locking context. Future updates aim to further refine this by removing redundant lock acquisitions and cleaning up misleading VM_SHARED checks throughout the userfaultfd codebase to ensure consistent handling of co-write versus non-co-write mappings, thereby restoring robust synchronization practices in high-concurrency memory management scenarios.