Bug 2345240 (CVE-2025-21696) - CVE-2025-21696 kernel: mm: clear uffd-wp PTE/PMD state on mremap()
Summary: CVE-2025-21696 kernel: mm: clear uffd-wp PTE/PMD state on mremap()
Keywords:
Status: NEW
Alias: CVE-2025-21696
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-02-12 14:09 UTC by OSIDB Bzimport
Modified: 2025-11-11 10:24 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2025:20095 0 None None None 2025-11-11 08:02:00 UTC
Red Hat Product Errata RHSA-2025:20518 0 None None None 2025-11-11 10:24:57 UTC

Description OSIDB Bzimport 2025-02-12 14:09:59 UTC
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.

Comment 3 errata-xmlrpc 2025-11-11 08:01:58 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 10

Via RHSA-2025:20095 https://access.redhat.com/errata/RHSA-2025:20095

Comment 4 errata-xmlrpc 2025-11-11 10:24:56 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2025:20518 https://access.redhat.com/errata/RHSA-2025:20518


Note You need to log in before you can comment on or make changes to this bug.