# CVE-2025-21696: mm: clear uffd-wp PTE/PMD state on mremap()

- 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.26%, higher than 19% of CVEs (2026-12-01)
- Published: 2025-02-12T13:27:54.905Z
- Modified: 2026-10-30T13:17:51.523Z
- 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: 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.

(As written by CVE List.)

## Affected

- 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 *)
- linux linux_kernel: from 5.7 before 6.12.11; 6.13

## 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/96fed9f20481d07eba8a7fe93bc77abef178198c>
- <https://git.kernel.org/stable/c/8e2f6ba256dd1e590addc48e6e9577bf39c482f2>
- <https://git.kernel.org/stable/c/310ac886d68de661c3a334198d8604b722d7fdf8> (patch)
- <https://git.kernel.org/stable/c/0cef0bb836e3cfe00f08f9606c72abd72fe78ca3> (patch)

## Sources

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

---

Page: https://cve.day/CVE-2025-21696 · Whole record: https://cve.day/CVE-2025-21696.json · Rebuilt by cve.day 2026-11-25T22:58:54.028Z
