CVE-2026-99911: mm/vma: avoid broken uffd merge on mremap
In the Linux kernel, the following vulnerability has been resolved:
mm/vma: avoid broken uffd merge on mremap
Userfaultfd often causes unexpected interactions within mm, and does so at the intersection of uffd, mremap() and VMA merging.
When an mremap of a VMA occurs, copyvmaanddata() calls mremapuserfaultfdprep() to notify uffd of this.
However, mremapuserfaultfdprep() simply drops the UFFD context for the VMA if the user did not register it for remap, i.e. didn't specify the UFFDFEATUREEVENTREMAP flag.
This is OK for the VMA itself, as upon page table move, moveptes() clears UFFD page table flags, using vmahasuffdwithouteventremap() to determine whether to do so.
However, this doesn't account for merging with adjacent VMAs, whose page tables won't have received this treatment, and thus latent UFFD markers will be left around.
Worse, it'll break UFFD for any VMAs it is merged with. This is very surprising behaviour for a user, who will then simply not receive UFFD events for VMAs they ought to.
Resolve the issue by explicitly checking for this case via vmahasuffdwithouteventremap() in vmamergecopiedrange(), the merge function explicitly designated for mremap() operations.
Also update the userland VMA tests accordingly.
Affected Software
Event History
Frequently Asked Questions
Which systems are realistically exposed to this issue?
Systems using the Linux kernel are affected in the scenario where userfaultfd-managed VMAs are remapped with mremap() and the userfaultfd registration does not include UFFD_FEATURE_EVENT_REMAP. The impact concerns userfaultfd event handling rather than all mremap() operations.
What conditions are needed to trigger the faulty behavior?
A userfaultfd-associated VMA must be remapped with mremap(), without having been registered for remap events, and the copied range must merge with adjacent VMAs. That merge can leave latent UFFD page-table markers and disrupt UFFD handling for merged VMAs.
How would an affected application behave?
An application may stop receiving userfaultfd events for VMAs for which it should receive them after the affected remap and merge sequence. The behavior is described as surprising because the loss of events can affect VMAs merged with the remapped range.