CVE-2026-43404: mm: Fix a hmm_range_fault() livelock / starvation problem
In the Linux kernel, the following vulnerability has been resolved:
mm: Fix a hmmrangefault() livelock / starvation problem
If hmmrangefault() fails a foliotrylock() in doswappage, trying to acquire the lock of a device-private folio for migration, to ram, the function will spin until it succeeds grabbing the lock.
However, if the process holding the lock is depending on a work item to be completed, which is scheduled on the same CPU as the spinning hmmrangefault(), that work item might be starved and we end up in a livelock / starvation situation which is never resolved.
This can happen, for example if the process holding the device-private folio lock is stuck in migratedeviceunmap()->lruadddrainall() sinc lruadddrainall() requires a short work-item to be run on all online cpus to complete.
A prerequisite for this to happen is: a) Both zone device and system memory folios are considered in migratedeviceunmap(), so that there is a reason to call lruadddrainall() for a system memory folio while a folio lock is held on a zone device folio. b) The zone device folio has an initial mapcount > 1 which causes at least one migration PTE entry insertion to be deferred to trytomigrate(), which can happen after the call to lruadddrainall(). c) No or voluntary only preemption.
This all seems pretty unlikely to happen, but indeed is hit by the "xeexecsystemallocator" igt test.
Resolve this by waiting for the folio to be unlocked if the foliotrylock() fails in doswappage().
Rename migrationentrywaitonlocked() to softleafentrywaitunlock() and update its documentation to indicate the new use-case.
Future code improvements might consider moving the lruadddrainall() call in migratedeviceunmap() to be called after all pages have migration entries inserted. That would eliminate also b) above.
v2: - Instead of a condresched() in hmmrangefault(), eliminate the problem by waiting for the folio to be unlocked in doswappage() (Alistair Popple, Andrew Morton) v3: - Add a stub migrationentrywaitonlocked() for the !CONFIGMIGRATION case. (Kernel Test Robot) v4: - Rename migrateentrywaitonlocked() to softleafentrywaitonlocked() and update docs (Alistair Popple) v5: - Add a WARNONONCE() for the !CONFIGMIGRATION version of softleafentrywaitonlocked(). - Modify wording around function names in the commit message (Andrew Morton)
(cherry picked from commit a69d1ab971a624c6f112cea61536569d579c3215)
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.19.10-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.116-1Fixed in 7.2.15-1Fixed in 7.3.4-1
Event History
Frequently Asked Questions
Is this exploitable remotely or without user interaction?
The reported vector is local (AV:L) and requires low privileges (PR:L). No user interaction is required (UI:N).
What conditions are needed to trigger the starvation scenario?
The issue requires migration involving both zone-device and system-memory folios in migrate_device_unmap(), and the zone-device folio must have an initial mapcount greater than 1. These conditions can cause migration PTE insertion to be deferred while a device-private folio lock is held.