{"id":"CVE-2025-39899","aliases":["CVE-2025-39899"],"related":[],"kind":"vulnerability","state":"published","title":"mm/userfaultfd: fix kmap_local LIFO ordering for CONFIG_HIGHPTE","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/userfaultfd: fix kmap_local LIFO ordering for CONFIG_HIGHPTE\n\nWith CONFIG_HIGHPTE on 32-bit ARM, move_pages_pte() maps PTE pages using\nkmap_local_page(), which requires unmapping in Last-In-First-Out order.\n\nThe current code maps dst_pte first, then src_pte, but unmaps them in the\nsame order (dst_pte, src_pte), violating the LIFO requirement.  This\ncauses the warning in kunmap_local_indexed():\n\n  WARNING: CPU: 0 PID: 604 at mm/highmem.c:622 kunmap_local_indexed+0x178/0x17c\n  addr \\!= __fix_to_virt(FIX_KMAP_BEGIN + idx)\n\nFix this by reversing the unmap order to respect LIFO ordering.\n\nThis issue follows the same pattern as similar fixes:\n- commit eca6828403b8 (\"crypto: skcipher - fix mismatch between mapping and unmapping order\")\n- commit 8cf57c6df818 (\"nilfs2: eliminate staggered calls to kunmap in nilfs_rename\")\n\nBoth of which addressed the same fundamental requirement that kmap_local\noperations must follow LIFO ordering.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/userfaultfd: fix kmap_local LIFO ordering for CONFIG_HIGHPTE\n\nWith CONFIG_HIGHPTE on 32-bit ARM, move_pages_pte() maps PTE pages using\nkmap_local_page(), which requires unmapping in Last-In-First-Out order.\n\nThe current code maps dst_pte first, then src_pte, but unmaps them in the\nsame order (dst_pte, src_pte), violating the LIFO requirement.  This\ncauses the warning in kunmap_local_indexed():\n\n  WARNING: CPU: 0 PID: 604 at mm/highmem.c:622 kunmap_local_indexed+0x178/0x17c\n  addr \\!= __fix_to_virt(FIX_KMAP_BEGIN + idx)\n\nFix this by reversing the unmap order to respect LIFO ordering.\n\nThis issue follows the same pattern as similar fixes:\n- commit eca6828403b8 (\"crypto: skcipher - fix mismatch between mapping and unmapping order\")\n- commit 8cf57c6df818 (\"nilfs2: eliminate staggered calls to kunmap in nilfs_rename\")\n\nBoth of which addressed the same fundamental requirement that kmap_local\noperations must follow LIFO ordering.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nmm/userfaultfd: corregir el orden LIFO de kmap_local para CONFIG_HIGHPTE\n\nCon CONFIG_HIGHPTE en ARM de 32 bits, move_pages_pte() mapea páginas PTE usando kmap_local_page(), lo que requiere desmapear en orden Último en Entrar, Primero en Salir.\n\nEl código actual mapea dst_pte primero, luego src_pte, pero los desmapea en el mismo orden (dst_pte, src_pte), violando el requisito LIFO. Esto causa la advertencia en kunmap_local_indexed():\n\n  WARNING: CPU: 0 PID: 604 at mm/highmem.c:622 kunmap_local_indexed+0x178/0x17c\n  addr \\!= __fix_to_virt(FIX_KMAP_BEGIN + idx)\n\nCorregir esto invirtiendo el orden de desmapeo para respetar el orden LIFO.\n\nEste problema sigue el mismo patrón que correcciones similares:\n- commit eca6828403b8 ('crypto: skcipher - corregir la falta de coincidencia entre el orden de mapeo y desmapeo')\n- commit 8cf57c6df818 ('nilfs2: eliminar llamadas escalonadas a kunmap en nilfs_rename')\n\nAmbos abordaron el mismo requisito fundamental de que las operaciones de kmap_local deben seguir el orden LIFO.","source":"nvd"}],"published":"2025-10-01T07:42:47.100Z","modified":"2026-10-19T21:10:00.160Z","severity":{"scorer":"CISA-ADP","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":"CISA-ADP","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"},{"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":[],"affected":[{"ranges":[{"type":"git","introduced":"adef440691bab824e39c1b17382322d195e1fab0","fixed":"b051f707018967ea8f697d790a1ed8c443f63812","status":"affected"},{"type":"git","introduced":"adef440691bab824e39c1b17382322d195e1fab0","fixed":"bd1ee62759d0bd4d6b909731c076c230ac89d61e","status":"affected"},{"type":"git","introduced":"adef440691bab824e39c1b17382322d195e1fab0","fixed":"9614d8bee66387501f48718fa306e17f2aa3f2f3","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.8","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.8","status":"unaffected"},{"type":"semver","introduced":"6.12.46","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.16.6","lastAffected":"6.16.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.17","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.8","fixed":"6.12.46"},{"status":"affected","introduced":"6.13","fixed":"6.16.6"},{"status":"affected","version":"6.17"},{"status":"affected","version":"6.17"},{"status":"affected","version":"6.17"},{"status":"affected","version":"6.17"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/b051f707018967ea8f697d790a1ed8c443f63812","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/bd1ee62759d0bd4d6b909731c076c230ac89d61e","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/9614d8bee66387501f48718fa306e17f2aa3f2f3","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-01-14T19:29:05.314Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-39899","url":"https://www.cve.org/CVERecord?id=CVE-2025-39899","licence":"CVE Terms of Use","modified":"2026-05-11T21:38:33.572Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-39899","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-39899","licence":"Public domain","modified":"2026-10-19T21:10:00.160Z"}],"updatedAt":"2026-11-25T22:59:05.382Z","epss":{"score":0.00152,"percentile":0.04617,"date":"2026-12-01T12:00:22.000Z"}}