mm/huge_memory: preserve pmd_swp_uffd_wp on device-private PMD downgrade
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
mm/huge_memory: preserve pmd_swp_uffd_wp on device-private PMD downgrade
change_non_present_huge_pmd() rewrites a writable device-private PMD swap entry into a readable one without carrying pmd_swp_uffd_wp() across. The PTE-level change_softleaf_pte() does this correctly; mirror that here, matching what copy_huge_pmd() does for the fork path. Without the carry, a plain mprotect() over a UFFD_WP-marked device-private THP strips the bit and the trap is bypassed on swap-in.
From the CVE record · Linux
The Linux kernel can lose a userfaultfd write-protection marker when mprotect() changes a writable device-private huge page entry to readable. If a device-private transparent huge page is marked for userfaultfd write protection, the write-protection trap can be bypassed when the page is swapped in. The input does not specify authentication requirements or other attacker prerequisites.
Engineers running the Linux kernel should check whether their kernel includes the affected huge-memory code; affected versions are not specified.