CVE-2026-99919: userfaultfd: fix UFFDIO_MOVE livelock on large folio with extra references
In the Linux kernel, the following vulnerability has been resolved:
userfaultfd: fix UFFDIOMOVE livelock on large folio with extra references
To move one page out of a large folio, movepagesptes() first has to split the folio. foliosplit() refuses if the folio has any reference beyond its page table mappings and the caller's own, and it reports the refusal as -EAGAIN. movepages() treats returned -EAGAIN as a transient race and keeps retrying the same address, holding the VMA read locks the whole time. This is incorrect since in some cases userspace can hold such a reference indefinitely, such as by registering the page as an iouring buffer.
An unprivileged user can trigger this with three threads: first holds such a reference on a page of a THP, second calls UFFDIOMOVE on another page of the same THP and spins in the kernel forever holding the VMA read locks, and third calls fork() or mprotect(), which takes mmaplock for writing and then waits forever for those read locks. From then on every mmaplock user of that mm hangs, including other processes inspecting it through /proc/<pid>/, until the process is SIGKILLed. The hung task detector reports the blocked tasks (third one), and with kernel.hungtaskpanic=1 the machine panics:
INFO: task wedge:95 blocked for more than 122 seconds. task:wedge state:D stack:12528 pid:95 tgid:95 ppid:94 Call Trace: schedule+0x596/0x1110 schedule+0x36/0xf0 vmastartexcludereaders+0x100/0x170 vmastartwrite+0x51/0xd0 splitvma+0x208/0x3d0 vmamodify+0x6a8/0x840 vmamodifyflags+0xce/0x110 mprotectfixup+0xbe/0x480 domprotectpkey+0x2d9/0x580 x64sysmprotect+0x1a/0x30
Fix by returning -EBUSY instead of -EAGAIN in movepagesptes(), the caller of splitfolio(), when the split fails. Thus, movepages() does not retry -EBUSY and the ioctl drops its locks and returns to userspace instead of spinning.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In move_pages_ptes(), return -EBUSY instead of -EAGAIN when splitting the folio fails, so move_pages() does not retry the same address indefinitely.
Event History
Frequently Asked Questions
Who can trigger this issue?
An unprivileged local user can trigger it using three threads in the affected process. The scenario requires a transparent huge page (THP), a persistent extra reference to a page in that THP, and a UFFDIO_MOVE operation targeting another page in the same THP.
What conditions make exploitation possible?
The attacker needs to hold an extra page reference that prevents the large folio from being split; the description gives registration as an io_uring buffer as an example. They then invoke UFFDIO_MOVE, which can repeatedly retry while retaining VMA read locks.
What is the operational impact after triggering it?
A thread performing fork() or mprotect() can block waiting for mmap_lock write access, while the UFFDIO_MOVE thread retains read locks. Subsequently, every mmap_lock user for that memory map can hang, including processes inspecting it through /proc/<pid>/, until the affected process is SIGKILLed.
How can administrators identify an active incident?
The hung task detector reports the blocked tasks. Relevant symptoms include a UFFDIO_MOVE caller spinning in the kernel and fork(), mprotect(), or /proc/<pid>/ inspection operations hanging against the affected process.