{"id":"CVE-2025-21696","state":"PUBLISHED","title":"mm: clear uffd-wp PTE/PMD state on mremap()","description":"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.","publishedAt":"2025-02-12T13:27:54.905Z","updatedAt":"2026-10-30T12:20:43.783Z","severity":{"score":5.5,"label":"Medium","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","source":"CISA-ADP"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"63b2d4174c4ad1f40b48d7138e71bcb564c1fe03","status":"affected","lessThan":"96fed9f20481d07eba8a7fe93bc77abef178198c","versionType":"git"},{"version":"63b2d4174c4ad1f40b48d7138e71bcb564c1fe03","status":"affected","lessThan":"8e2f6ba256dd1e590addc48e6e9577bf39c482f2","versionType":"git"},{"version":"63b2d4174c4ad1f40b48d7138e71bcb564c1fe03","status":"affected","lessThan":"310ac886d68de661c3a334198d8604b722d7fdf8","versionType":"git"},{"version":"63b2d4174c4ad1f40b48d7138e71bcb564c1fe03","status":"affected","lessThan":"0cef0bb836e3cfe00f08f9606c72abd72fe78ca3","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/linux/userfaultfd_k.h","mm/huge_memory.c","mm/hugetlb.c","mm/mremap.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.7","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.7","versionType":"semver"},{"version":"6.1.191","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.160","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.11","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/linux/userfaultfd_k.h","mm/huge_memory.c","mm/hugetlb.c","mm/mremap.c"]}],"references":["https://git.kernel.org/stable/c/96fed9f20481d07eba8a7fe93bc77abef178198c","https://git.kernel.org/stable/c/8e2f6ba256dd1e590addc48e6e9577bf39c482f2","https://git.kernel.org/stable/c/310ac886d68de661c3a334198d8604b722d7fdf8","https://git.kernel.org/stable/c/0cef0bb836e3cfe00f08f9606c72abd72fe78ca3"],"weaknesses":[],"ingestedAt":"2026-10-30T12:38:04.623Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/21xxx/CVE-2025-21696.json","commit":"db8103c5921aac81d5d90efcf3745980dafabf49","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-21696","state":"PUBLISHED","datePublished":"2025-02-12T13:27:54.905Z","dateUpdated":"2026-10-30T12:20:43.783Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-12-29T08:45:45.743Z"},"containers":{"cna":{"title":"mm: clear uffd-wp PTE/PMD state on mremap()","descriptions":[{"lang":"en","value":"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."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"63b2d4174c4ad1f40b48d7138e71bcb564c1fe03","status":"affected","lessThan":"96fed9f20481d07eba8a7fe93bc77abef178198c","versionType":"git"},{"version":"63b2d4174c4ad1f40b48d7138e71bcb564c1fe03","status":"affected","lessThan":"8e2f6ba256dd1e590addc48e6e9577bf39c482f2","versionType":"git"},{"version":"63b2d4174c4ad1f40b48d7138e71bcb564c1fe03","status":"affected","lessThan":"310ac886d68de661c3a334198d8604b722d7fdf8","versionType":"git"},{"version":"63b2d4174c4ad1f40b48d7138e71bcb564c1fe03","status":"affected","lessThan":"0cef0bb836e3cfe00f08f9606c72abd72fe78ca3","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/linux/userfaultfd_k.h","mm/huge_memory.c","mm/hugetlb.c","mm/mremap.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.7","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.7","versionType":"semver"},{"version":"6.1.191","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.160","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.11","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/linux/userfaultfd_k.h","mm/huge_memory.c","mm/hugetlb.c","mm/mremap.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/96fed9f20481d07eba8a7fe93bc77abef178198c"},{"url":"https://git.kernel.org/stable/c/8e2f6ba256dd1e590addc48e6e9577bf39c482f2"},{"url":"https://git.kernel.org/stable/c/310ac886d68de661c3a334198d8604b722d7fdf8"},{"url":"https://git.kernel.org/stable/c/0cef0bb836e3cfe00f08f9606c72abd72fe78ca3"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-10-30T12:20:43.783Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.7","versionEndExcluding":"6.1.191"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.7","versionEndExcluding":"6.6.160"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.7","versionEndExcluding":"6.12.11"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.7","versionEndExcluding":"6.13"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":5.5,"attackVector":"LOCAL","baseSeverity":"MEDIUM","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","integrityImpact":"NONE","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"HIGH","privilegesRequired":"LOW","confidentialityImpact":"NONE"}},{"other":{"type":"ssvc","content":{"id":"CVE-2025-21696","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2025-10-01T19:51:14.846865Z"}}}],"problemTypes":[{"descriptions":[{"lang":"en","type":"CWE","description":"CWE-noinfo Not enough information"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-10-01T19:57:09.649Z"}}]}}}