{"id":"CVE-2025-21696","aliases":["CVE-2025-21696"],"related":[],"kind":"vulnerability","state":"published","title":"mm: clear uffd-wp PTE/PMD state on mremap()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm: clear uffd-wp PTE/PMD state on mremap()\n\nWhen mremap()ing a memory region previously registered with userfaultfd as\nwrite-protected but without UFFD_FEATURE_EVENT_REMAP, an inconsistency in\nflag clearing leads to a mismatch between the vma flags (which have\nuffd-wp cleared) and the pte/pmd flags (which do not have uffd-wp\ncleared).  This mismatch causes a subsequent mprotect(PROT_WRITE) to\ntrigger a warning in page_table_check_pte_flags() due to setting the pte\nto writable while uffd-wp is still set.\n\nFix this by always explicitly clearing the uffd-wp pte/pmd flags on any\nsuch mremap() so that the values are consistent with the existing clearing\nof VM_UFFD_WP.  Be careful to clear the logical flag regardless of its\nphysical form; a PTE bit, a swap PTE bit, or a PTE marker.  Cover PTE,\nhuge PMD and hugetlb paths.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm: clear uffd-wp PTE/PMD state on mremap()\n\nWhen mremap()ing a memory region previously registered with userfaultfd as\nwrite-protected but without UFFD_FEATURE_EVENT_REMAP, an inconsistency in\nflag clearing leads to a mismatch between the vma flags (which have\nuffd-wp cleared) and the pte/pmd flags (which do not have uffd-wp\ncleared).  This mismatch causes a subsequent mprotect(PROT_WRITE) to\ntrigger a warning in page_table_check_pte_flags() due to setting the pte\nto writable while uffd-wp is still set.\n\nFix this by always explicitly clearing the uffd-wp pte/pmd flags on any\nsuch mremap() so that the values are consistent with the existing clearing\nof VM_UFFD_WP.  Be careful to clear the logical flag regardless of its\nphysical form; a PTE bit, a swap PTE bit, or a PTE marker.  Cover PTE,\nhuge PMD and hugetlb paths.","source":"cvelist"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2025-02-12T13:27:54.905Z","modified":"2026-10-30T13:17:51.523Z","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":"63b2d4174c4ad1f40b48d7138e71bcb564c1fe03","fixed":"96fed9f20481d07eba8a7fe93bc77abef178198c","status":"affected"},{"type":"git","introduced":"63b2d4174c4ad1f40b48d7138e71bcb564c1fe03","fixed":"8e2f6ba256dd1e590addc48e6e9577bf39c482f2","status":"affected"},{"type":"git","introduced":"63b2d4174c4ad1f40b48d7138e71bcb564c1fe03","fixed":"310ac886d68de661c3a334198d8604b722d7fdf8","status":"affected"},{"type":"git","introduced":"63b2d4174c4ad1f40b48d7138e71bcb564c1fe03","fixed":"0cef0bb836e3cfe00f08f9606c72abd72fe78ca3","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.7","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.7","status":"unaffected"},{"type":"semver","introduced":"6.1.191","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.160","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.11","lastAffected":"6.12.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.13","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":"5.7","fixed":"6.12.11"},{"status":"affected","version":"6.13"},{"status":"affected","version":"6.13"},{"status":"affected","version":"6.13"},{"status":"affected","version":"6.13"},{"status":"affected","version":"6.13"},{"status":"affected","version":"6.13"},{"status":"affected","version":"6.13"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/96fed9f20481d07eba8a7fe93bc77abef178198c","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/8e2f6ba256dd1e590addc48e6e9577bf39c482f2","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/310ac886d68de661c3a334198d8604b722d7fdf8","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/0cef0bb836e3cfe00f08f9606c72abd72fe78ca3","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-10-01T19:51:14.846Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-21696","url":"https://www.cve.org/CVERecord?id=CVE-2025-21696","licence":"CVE Terms of Use","modified":"2026-10-30T12:20:43.783Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-21696","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-21696","licence":"Public domain","modified":"2026-10-30T13:17:51.523Z"}],"updatedAt":"2026-11-25T22:58:54.028Z","epss":{"score":0.00262,"percentile":0.19225,"date":"2026-12-01T12:00:22.000Z"}}