5.5medium
mm: clear uffd-wp PTE/PMD state on mremap()
- Severity
- 5.5medium CVSS:3.1 by CISA-ADP
- Exploit likelihood
- 0.26% (higher than 19% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: mm: clear uffd-wp PTE/PMD state on mremap() When mremap()ing a memory region previously registered with userfaultfd as write-protected but without UFFD_FEATURE_EVENT_REMAP, an inconsistency in flag clearing leads to a mismatch between the vma flags (which have uffd-wp cleared) and the pte/pmd flags (which do not have uffd-wp cleared). This mismatch causes a subsequent mprotect(PROT_WRITE) to trigger a warning in page_table_check_pte_flags() due to setting the pte to writable while uffd-wp is still set. Fix this by always explicitly clearing the uffd-wp pte/pmd flags on any such mremap() so that the values are consistent with the existing clearing of VM_UFFD_WP. Be careful to clear the logical flag regardless of its physical form; a PTE bit, a swap PTE bit, or a PTE marker. Cover PTE, huge PMD and hugetlb paths.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from 63b2d4174c4ad1f40b48d7138e71bcb564c1fe03 before 96fed9f20481d07eba8a7fe93bc77abef178198c, from 63b2d4174c4ad1f40b48d7138e71bcb564c1fe03 before 8e2f6ba256dd1e590addc48e6e9577bf39c482f2, from 63b2d4174c4ad1f40b48d7138e71bcb564c1fe03 before 310ac886d68de661c3a334198d8604b722d7fdf8, from 63b2d4174c4ad1f40b48d7138e71bcb564c1fe03 before 0cef0bb836e3cfe00f08f9606c72abd72fe78ca3, 5.7 Not affected: before 5.7, from 6.1.191 up to 6.1.*, from 6.6.160 up to 6.6.*, from 6.12.11 up to 6.12.*, from 6.13 up to * | CVE List |
| linux linux_kernel | from 5.7 before 6.12.11, 6.13 | NVD |
All scores
| CISA-ADP | 5.5medium CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
| NVD | 5.5medium CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
In the Linux kernel, the following vulnerability has been resolved: mm: clear uffd-wp PTE/PMD state on mremap() When mremap()ing a memory region previously registered with userfaultfd as write-protected but without UFFD_FEATURE_EVENT_REMAP, an inconsistency in flag clearing leads to a mismatch between the vma flags (which have uffd-wp cleared) and the pte/pmd flags (which do not have uffd-wp cleared). This mismatch causes a subsequent mprotect(PROT_WRITE) to trigger a warning in page_table_check_pte_flags() due to setting the pte to writable while uffd-wp is still set. Fix this by always explicitly clearing the uffd-wp pte/pmd flags on any such mremap() so that the values are consistent with the existing clearing of VM_UFFD_WP. Be careful to clear the logical flag regardless of its physical form; a PTE bit, a swap PTE bit, or a PTE marker. Cover PTE, huge PMD and hugetlb paths.
NVD (es)
En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: mm: borrar el estado PTE/PMD de uffd-wp en mremap() Al borrar con mremap() una región de memoria registrada previamente con userfaultfd como protegida contra escritura pero sin UFFD_FEATURE_EVENT_REMAP, una inconsistencia en la depuración de indicadores provoca una falta de coincidencia entre los indicadores vma (que tienen uffd-wp borrado) y los indicadores pte/pmd (que no tienen uffd-wp borrado). Esta falta de coincidencia hace que un mprotect(PROT_WRITE) posterior active una advertencia en page_table_check_pte_flags() debido a la configuración de pte como escribible mientras uffd-wp aún está configurado. Solucione esto borrando siempre explícitamente los indicadores pte/pmd de uffd-wp en cualquier mremap() de este tipo para que los valores sean coherentes con la depuración existente de VM_UFFD_WP. Tenga cuidado de borrar el indicador lógico independientemente de su forma física: un bit PTE, un bit PTE de intercambio o un marcador PTE. Cubra las rutas PTE, PMD enormes y TLB enormes.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-21696 changed 2026-10-30 | CVE Terms of Use |
| NVD | CVE-2025-21696 changed 2026-10-30 | Public domain |