CVE-2026-99700: mm/hugetlb_vmemmap: map the shared tail page writable
In the Linux kernel, the following vulnerability has been resolved:
mm/hugetlbvmemmap: map the shared tail page writable
pagerefaddunlesszero() reads the refcount and then updates it with a cmpxchg. A lockless get, such as a page cache lookup or a PFN scanner, can read a non-zero refcount from a page that is then freed and reused as a hugetlb tail page. If HVO remaps its struct page to the shared tail page in between, the cmpxchg writes to read-only vmemmap:
CPU0 (lockless get) CPU1 c = atomicread(&page->refcount) page freed page allocated as a hugetlb tail HVO remaps the struct page RO trycmpxchg(&page->refcount, &c, c + 1) -> write fault on read-only vmemmap
The refcount is zero by then and the compare fails, but a compare-and-swap instruction needs write access whether or not it succeeds. The kernel oopses when hugetlb pages are allocated at runtime with HVO enabled while a lockless get races with it.
Commit bd225530a4c7 ("mm/hugetlbvmemmap: fix race with speculative PFN walkers") closed the window with RCU on both sides. The RCU was removed together with fake heads, on the wrong belief that it was only needed for them.
Map the shared tail page writable instead of restoring the RCU. Every struct page on it is a tail with a zero refcount, so a late cmpxchg fails and leaves the page unchanged. RCU would put rcureadlock() back around every get and synchronizercu() back into hugetlb allocation and freeing.
The cost is the protection against stray writes to tail struct pages. The shared page is shared by all hugetlb folios of the same order in the zone, so such a write now corrupts all of them instead of oopsing.
Bootmem folios optimized when the memmap is set up keep their tails read-only. Nothing does a lockless get on them before hugetlb takes them over.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.64 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.5 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.176-1Fixed in 6.1.192-2Fixed in 6.12.107-1Fixed in 6.12.117-1Fixed in 7.3.5-1 - Compensating control
In hugetlb_vmemmap, map the shared tail page writable instead of restoring RCU.
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
Linux kernel systems are exposed when hugetlb pages are allocated at runtime with hugetlb vmemmap optimization (HVO) enabled. The failure requires a concurrent lockless page-reference acquisition, such as a page-cache lookup or PFN scanner.
What is the practical impact if the race occurs?
The kernel can oops when a compare-and-swap operation attempts to update a refcount through a read-only remapped vmemmap page. This is a kernel stability and availability issue.
What conditions are needed to trigger the fault?
A page must be freed and reused as a hugetlb tail page while a lockless getter has observed a nonzero prior refcount. HVO must then remap that struct page to the shared tail page before the getter performs its compare-and-swap.
What change resolves the issue?
The fix maps the shared tail page writable, so the compare-and-swap can safely access the refcount even when its comparison ultimately fails. Referenced stable kernel commits include f96a68bab26183433ea542dfb29ec41125f9fe39, e570f2c29fc07a1040c3736bf1a1dfa8065d5099, and 0120a603afadba8ab4954bb1ce60f8195f80efc8.