CVE-2026-99664: mm/gup: recheck the PUD under PTL in follow_pud_mask()
In the Linux kernel, the following vulnerability has been resolved:
mm/gup: recheck the PUD under PTL in followpudmask()
followpudmask() reads the PUD without a lock. If it is a leaf, it takes the lock and calls followhugepud(), which reads the entry again, but only tests whether it is present.
A leaf can be zapped concurrently and a page fault can fill the empty entry with a page table.
This currently only applies when device-dax makes use of PUD entries, and the fault after e.g., MADVDONTNEED would find THPs to be disabled.
That requires a sequence like
1) Fault in the PUD 2) Disable THP 3) Have GUP race against concurrent MADVDONTNEED + refault
Which is rather unlikely to happen in practice, which is why we never received a report about such a problem.
Before commit 1b1676180246 ("mm/gup: handle huge pud for followpudmask()"), we performed that check in followdevmappud() by testing for puddevmap().
Let's fix it by just structuring followpudmask() similar to followpmdmask(), minus protnone stuff that does not apply and minus FOLLSPLITPMD handling. That makes it much easier to spot any such inconsistencies.
Perform the pudbad() check early in followpmdmask() and just forward the PUD value. We can drop the pudpresent() check in followhugepud(), just like we have in followhugepmd().
Even though we are performing more changes than strictly necessary, the fix should be easy to backport.
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 7.3.5-1
Event History
Frequently Asked Questions
Which systems are realistically exposed to this race?
The issue currently applies when device-dax uses PUD entries. Exploitation also depends on a specific sequence involving a PUD fault, disabling THP, and a GUP race with concurrent MADV_DONTNEED followed by a refault, which the description characterizes as unlikely in practice.
What concurrent activity is required to trigger the issue?
A PUD leaf must be zapped concurrently while GUP is operating, and a page fault must refill the emptied entry with a page table. The described scenario requires GUP to race with MADV_DONTNEED and a subsequent refault after THP has been disabled.
Is there evidence that this issue has been observed in the wild?
No report of the problem had been received according to the description. The required sequence is described as sufficiently unlikely that the issue had not previously been reported.