{"id":"CVE-2026-43404","aliases":["CVE-2026-43404"],"related":[],"kind":"vulnerability","state":"published","title":"mm: Fix a hmm_range_fault() livelock / starvation problem","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm: Fix a hmm_range_fault() livelock / starvation problem\n\nIf hmm_range_fault() fails a folio_trylock() in do_swap_page,\ntrying to acquire the lock of a device-private folio for migration,\nto ram, the function will spin until it succeeds grabbing the lock.\n\nHowever, if the process holding the lock is depending on a work\nitem to be completed, which is scheduled on the same CPU as the\nspinning hmm_range_fault(), that work item might be starved and\nwe end up in a livelock / starvation situation which is never\nresolved.\n\nThis can happen, for example if the process holding the\ndevice-private folio lock is stuck in\n   migrate_device_unmap()->lru_add_drain_all()\nsinc lru_add_drain_all() requires a short work-item\nto be run on all online cpus to complete.\n\nA prerequisite for this to happen is:\na) Both zone device and system memory folios are considered in\n   migrate_device_unmap(), so that there is a reason to call\n   lru_add_drain_all() for a system memory folio while a\n   folio lock is held on a zone device folio.\nb) The zone device folio has an initial mapcount > 1 which causes\n   at least one migration PTE entry insertion to be deferred to\n   try_to_migrate(), which can happen after the call to\n   lru_add_drain_all().\nc) No or voluntary only preemption.\n\nThis all seems pretty unlikely to happen, but indeed is hit by\nthe \"xe_exec_system_allocator\" igt test.\n\nResolve this by waiting for the folio to be unlocked if the\nfolio_trylock() fails in do_swap_page().\n\nRename migration_entry_wait_on_locked() to\nsoftleaf_entry_wait_unlock() and update its documentation to\nindicate the new use-case.\n\nFuture code improvements might consider moving\nthe lru_add_drain_all() call in migrate_device_unmap() to be\ncalled *after* all pages have migration entries inserted.\nThat would eliminate also b) above.\n\nv2:\n- Instead of a cond_resched() in hmm_range_fault(),\n  eliminate the problem by waiting for the folio to be unlocked\n  in do_swap_page() (Alistair Popple, Andrew Morton)\nv3:\n- Add a stub migration_entry_wait_on_locked() for the\n  !CONFIG_MIGRATION case. (Kernel Test Robot)\nv4:\n- Rename migrate_entry_wait_on_locked() to\n  softleaf_entry_wait_on_locked() and update docs (Alistair Popple)\nv5:\n- Add a WARN_ON_ONCE() for the !CONFIG_MIGRATION\n  version of softleaf_entry_wait_on_locked().\n- Modify wording around function names in the commit message\n  (Andrew Morton)\n\n(cherry picked from commit a69d1ab971a624c6f112cea61536569d579c3215)","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm: Fix a hmm_range_fault() livelock / starvation problem\n\nIf hmm_range_fault() fails a folio_trylock() in do_swap_page,\ntrying to acquire the lock of a device-private folio for migration,\nto ram, the function will spin until it succeeds grabbing the lock.\n\nHowever, if the process holding the lock is depending on a work\nitem to be completed, which is scheduled on the same CPU as the\nspinning hmm_range_fault(), that work item might be starved and\nwe end up in a livelock / starvation situation which is never\nresolved.\n\nThis can happen, for example if the process holding the\ndevice-private folio lock is stuck in\n   migrate_device_unmap()->lru_add_drain_all()\nsinc lru_add_drain_all() requires a short work-item\nto be run on all online cpus to complete.\n\nA prerequisite for this to happen is:\na) Both zone device and system memory folios are considered in\n   migrate_device_unmap(), so that there is a reason to call\n   lru_add_drain_all() for a system memory folio while a\n   folio lock is held on a zone device folio.\nb) The zone device folio has an initial mapcount > 1 which causes\n   at least one migration PTE entry insertion to be deferred to\n   try_to_migrate(), which can happen after the call to\n   lru_add_drain_all().\nc) No or voluntary only preemption.\n\nThis all seems pretty unlikely to happen, but indeed is hit by\nthe \"xe_exec_system_allocator\" igt test.\n\nResolve this by waiting for the folio to be unlocked if the\nfolio_trylock() fails in do_swap_page().\n\nRename migration_entry_wait_on_locked() to\nsoftleaf_entry_wait_unlock() and update its documentation to\nindicate the new use-case.\n\nFuture code improvements might consider moving\nthe lru_add_drain_all() call in migrate_device_unmap() to be\ncalled *after* all pages have migration entries inserted.\nThat would eliminate also b) above.\n\nv2:\n- Instead of a cond_resched() in hmm_range_fault(),\n  eliminate the problem by waiting for the folio to be unlocked\n  in do_swap_page() (Alistair Popple, Andrew Morton)\nv3:\n- Add a stub migration_entry_wait_on_locked() for the\n  !CONFIG_MIGRATION case. (Kernel Test Robot)\nv4:\n- Rename migrate_entry_wait_on_locked() to\n  softleaf_entry_wait_on_locked() and update docs (Alistair Popple)\nv5:\n- Add a WARN_ON_ONCE() for the !CONFIG_MIGRATION\n  version of softleaf_entry_wait_on_locked().\n- Modify wording around function names in the commit message\n  (Andrew Morton)\n\n(cherry picked from commit a69d1ab971a624c6f112cea61536569d579c3215)","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: mm: Corrige un problema de interbloqueo / inanición de hmm_range_fault() Si hmm_range_fault() falla un folio_trylock() en do_swap_page, intentando adquirir el bloqueo de un folio privado de dispositivo para migración, a la RAM, la función girará hasta que logre adquirir el bloqueo. Sin embargo, si el proceso que mantiene el bloqueo depende de que se complete un elemento de trabajo, el cual está programado en la misma CPU que el hmm_range_fault() en espera activa, ese elemento de trabajo podría sufrir inanición y terminamos en una situación de interbloqueo / inanición que nunca se resuelve. Esto puede ocurrir, por ejemplo, si el proceso que mantiene el bloqueo del folio privado del dispositivo está atascado en migrate_device_unmap()  ->  lru_add_drain_all()\nya que lru_add_drain_all() requiere que se ejecute un elemento de trabajo corto en todas las CPUs en línea para completarse. Un requisito previo para que esto ocurra es:\na) Tanto los folios de dispositivo de zona como los de memoria del sistema se consideran en migrate_device_unmap(), de modo que hay una razón para llamar a lru_add_drain_all() para un folio de memoria del sistema mientras se mantiene un bloqueo de folio en un folio de dispositivo de zona.\nb) El folio de dispositivo de zona tiene un mapcount inicial mayor que 1 lo que provoca que al menos una inserción de entrada PTE de migración se posponga a try_to_migrate(), lo cual puede ocurrir después de la llamada a lru_add_drain_all().\nc) Sin o solo con expropiación voluntaria. Todo esto parece bastante improbable que ocurra, pero de hecho es afectado por la prueba igt ’xe_exec_system_allocator’. Resuelve esto esperando a que el folio se desbloquee si el folio_trylock() falla en do_swap_page(). Renombra migration_entry_wait_on_locked() a softleaf_entry_wait_unlock() y actualiza su documentación para indicar el nuevo caso de uso. Futuras mejoras de código podrían considerar mover la llamada a lru_add_drain_all() en migrate_device_unmap() para que se llame después de que todas las páginas tengan entradas de migración insertadas.\nEso eliminaría también b) lo anterior. v2:\n- En lugar de un cond_resched() en hmm_range_fault(), elimina el problema esperando a que el folio se desbloquee en do_swap_page() (Alistair Popple, Andrew Morton)\nv3:\n- Añade un stub migration_entry_wait_on_locked() para el caso !CONFIG_MIGRATION. (Kernel Test Robot)\nv4:\n- Renombra migrate_entry_wait_on_locked() a softleaf_entry_wait_on_locked() y actualiza la documentación (Alistair Popple)\nv5:\n- Añade un WARN_ON_ONCE() para la versión !CONFIG_MIGRATION de softleaf_entry_wait_on_locked().\n- Modifica la redacción en torno a los nombres de las funciones en el mensaje de commit (Andrew Morton) (seleccionado de commit a69d1ab971a624c6f112cea61536569d579c3215)","source":"nvd"}],"published":"2026-05-08T14:21:44.929Z","modified":"2026-11-11T20:10:00.273Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":["CWE-667"],"affected":[{"ranges":[{"type":"git","introduced":"1afaeb8293c9addbf4f9140bdd22635fed763459","fixed":"94b6d0ba4b640ba23bb6c708a59316e74e5ede63","status":"affected"},{"type":"git","introduced":"1afaeb8293c9addbf4f9140bdd22635fed763459","fixed":"7e6e2fc91d4b9b12ec6e137019532568ebcf2680","status":"affected"},{"type":"git","introduced":"1afaeb8293c9addbf4f9140bdd22635fed763459","fixed":"b570f37a2ce480be26c665345c5514686a8a0274","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.15","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.15","status":"unaffected"},{"type":"semver","introduced":"6.18.19","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"6.19.9","lastAffected":"6.19.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.0","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"6.15","fixed":"6.18.19"},{"status":"affected","introduced":"6.19","fixed":"6.19.9"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/94b6d0ba4b640ba23bb6c708a59316e74e5ede63","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/7e6e2fc91d4b9b12ec6e137019532568ebcf2680","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/b570f37a2ce480be26c665345c5514686a8a0274","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-43404","url":"https://www.cve.org/CVERecord?id=CVE-2026-43404","licence":"CVE Terms of Use","modified":"2026-05-11T22:23:55.638Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-43404","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-43404","licence":"Public domain","modified":"2026-11-11T20:10:00.273Z"}],"updatedAt":"2026-11-25T22:59:21.049Z","epss":{"score":0.00124,"percentile":0.00964,"date":"2026-11-29T12:00:22.000Z"}}