{"id":"CVE-2026-99701","aliases":[],"title":"mm/ksm: fix userfaultfd protection during merge and unmerge","originalDescription":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/ksm: fix userfaultfd protection during merge and unmerge\n\nKSM loses userfaultfd protection when replace_page() builds a new PTE from\nvma->vm_page_prot.  Dropping its uffd bit lets a subsequent write go\nthrough ordinary COW instead of userfaultfd write protection handling. \nFor RWP, a merged page also becomes readable without faulting.\n\nKeeping the uffd bit and restoring PAGE_NONE fixes merging, but we also\nhave to handle unmerging.  An existing KSM page can be protected with RWP\nbefore MADV_UNMERGEABLE, so unmerging already needs fixing independently\nof preserving RWP during merging.\n\nUnsharing replaces a shared page with a private one and should leave\nuserfaultfd protection in place, as do_wp_page() already does for write\nprotection.  Currently, an unshare fault reaches do_uffd_rwp() before it\ncan proceed to do_wp_page().\n\n- With synchronous RWP, handle_userfault() returns VM_FAULT_SIGBUS.\n  break_ksm() then reports success with a KSM page still merged.\n\n- With asynchronous RWP, protection is cleared before unsharing.\n\nPreserve the uffd bit when merging, and restore PAGE_NONE for RWP.  Let\nFAULT_FLAG_UNSHARE skip RWP fault handling and keep PAGE_NONE on each\nprivate copy as well.  Unsharing can then complete with RWP still armed\nfor a subsequent access.","severity":{"cvss":null,"vector":null,"label":null},"exploitation":{"kev":null,"epss":{"score":0.00168,"percentile":0.06428},"exploitDb":null},"affected":[{"ecosystem":"Linux","name":"Kernel","range":">=5.7.0, <6.12.120","fixed":"6.12.120"},{"ecosystem":"Linux","name":"Kernel","range":">=5.7.0, <7.3.5","fixed":"7.3.5"},{"ecosystem":"Linux","name":"Kernel","range":">=6.13.0, <6.18.66","fixed":"6.18.66"},{"ecosystem":"Linux","name":"Kernel","range":">=6.19.0, <7.3.5","fixed":"7.3.5"},{"ecosystem":"vendor","name":"Linux","range":">=63b2d4174c4ad1f40b48d7138e71bcb564c1fe03, <4712cc65a41d0e69117fbf5b977a4f3e3e7bed05","fixed":"4712cc65a41d0e69117fbf5b977a4f3e3e7bed05"},{"ecosystem":"vendor","name":"Linux","range":">=63b2d4174c4ad1f40b48d7138e71bcb564c1fe03, <5cf7267b79f276c27825a2ebb95deda788a29e77","fixed":"5cf7267b79f276c27825a2ebb95deda788a29e77"},{"ecosystem":"vendor","name":"Linux","range":">=63b2d4174c4ad1f40b48d7138e71bcb564c1fe03, <990d6c2194a938a19a8cf94c6cfd75171345089b","fixed":"990d6c2194a938a19a8cf94c6cfd75171345089b"},{"ecosystem":"vendor","name":"Linux","range":">=63b2d4174c4ad1f40b48d7138e71bcb564c1fe03, <c511c0af3653e753e1b7f00a1fb0c7c7a204a20a","fixed":"c511c0af3653e753e1b7f00a1fb0c7c7a204a20a"}],"references":[{"url":"https://git.kernel.org/stable/c/5cf7267b79f276c27825a2ebb95deda788a29e77","type":"other"},{"url":"https://git.kernel.org/stable/c/990d6c2194a938a19a8cf94c6cfd75171345089b","type":"other"},{"url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","type":"package"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/99xxx/CVE-2026-99701.json","type":"advisory"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-99701","type":"advisory"},{"url":"https://git.kernel.org/stable/c/c511c0af3653e753e1b7f00a1fb0c7c7a204a20a","type":"other"},{"url":"https://git.kernel.org/stable/c/4712cc65a41d0e69117fbf5b977a4f3e3e7bed05","type":"other"}],"sources":[{"name":"nvd","at":"2026-11-30T12:26:25.825Z","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-99701","license":"NVD terms of use","firstSeenAt":"2026-11-20T06:30:46.205Z"},{"name":"osv","at":"2026-11-30T14:38:43.580Z","url":"https://osv.dev/vulnerability/CVE-2026-99701","license":"CC-BY 4.0","firstSeenAt":"2026-11-20T07:04:08.049Z"},{"name":"cvelistV5","at":"2026-12-01T19:19:07.487Z","url":"https://www.cve.org/CVERecord?id=CVE-2026-99701","license":"CVE Terms of Use","firstSeenAt":"2026-11-20T06:28:15.235Z"}],"firstSeenAt":"2026-11-20T06:28:15.235Z","publishedAt":"2026-11-20T05:50:43.269Z","modifiedAt":"2026-11-30T14:00:56.332Z"}