# CVE-2025-39899: mm/userfaultfd: fix kmap_local LIFO ordering for CONFIG_HIGHPTE

- Severity: Medium 5.5 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.15%, higher than 4% of CVEs (2026-12-01)
- Published: 2025-10-01T07:42:47.100Z
- Modified: 2026-10-19T21:10:00.160Z
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

mm/userfaultfd: fix kmap_local LIFO ordering for CONFIG_HIGHPTE

With CONFIG_HIGHPTE on 32-bit ARM, move_pages_pte() maps PTE pages using
kmap_local_page(), which requires unmapping in Last-In-First-Out order.

The current code maps dst_pte first, then src_pte, but unmaps them in the
same order (dst_pte, src_pte), violating the LIFO requirement.  This
causes the warning in kunmap_local_indexed():

  WARNING: CPU: 0 PID: 604 at mm/highmem.c:622 kunmap_local_indexed+0x178/0x17c
  addr \!= __fix_to_virt(FIX_KMAP_BEGIN + idx)

Fix this by reversing the unmap order to respect LIFO ordering.

This issue follows the same pattern as similar fixes:
- commit eca6828403b8 ("crypto: skcipher - fix mismatch between mapping and unmapping order")
- commit 8cf57c6df818 ("nilfs2: eliminate staggered calls to kunmap in nilfs_rename")

Both of which addressed the same fundamental requirement that kmap_local
operations must follow LIFO ordering.

(As written by CVE List.)

## Affected

- Linux Linux: from adef440691bab824e39c1b17382322d195e1fab0 before b051f707018967ea8f697d790a1ed8c443f63812; from adef440691bab824e39c1b17382322d195e1fab0 before bd1ee62759d0bd4d6b909731c076c230ac89d61e; from adef440691bab824e39c1b17382322d195e1fab0 before 9614d8bee66387501f48718fa306e17f2aa3f2f3; 6.8 (not affected: before 6.8; from 6.12.46 up to 6.12.*; from 6.16.6 up to 6.16.*; from 6.17 up to *)
- linux linux_kernel: from 6.8 before 6.12.46; from 6.13 before 6.16.6; 6.17

## Every score

- CISA-ADP: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://git.kernel.org/stable/c/b051f707018967ea8f697d790a1ed8c443f63812> (patch)
- <https://git.kernel.org/stable/c/bd1ee62759d0bd4d6b909731c076c230ac89d61e> (patch)
- <https://git.kernel.org/stable/c/9614d8bee66387501f48718fa306e17f2aa3f2f3> (patch)

## Sources

- CVE List: [CVE-2025-39899](https://www.cve.org/CVERecord?id=CVE-2025-39899), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2025-39899](https://nvd.nist.gov/vuln/detail/CVE-2025-39899), Public domain, modified 2026-10-19

---

Page: https://cve.day/CVE-2025-39899 · Whole record: https://cve.day/CVE-2025-39899.json · Rebuilt by cve.day 2026-11-25T22:59:05.382Z
