PT-2026-152460
CVE-2026-99580
·
Published
2026-11-20
·
Updated
2026-11-20
Description by
CVSS 3.1
7.8
HighMetricsAV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
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.
Found an issue in the description? Have something to add? Feel free to write us 👾