The patch titled Subject: fixup: mm/userfaultfd: enable writenotify while userfaultfd-wp is enabled for a VMA has been added to the -mm mm-unstable branch. Its filename is mm-userfaultfd-rely-on-vma-vm_page_prot-in-uffd_wp_range-fix.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-userfaultfd-rely-on-vma-vm_page_prot-in-uffd_wp_range-fix.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: David Hildenbrand <david@xxxxxxxxxx> Subject: fixup: mm/userfaultfd: enable writenotify while userfaultfd-wp is enabled for a VMA Date: Sat, 24 Dec 2022 15:02:36 +0100 No need for additional harmless checks if we're wr-protecting either way. Link: https://lkml.kernel.org/r/71412742-a71f-9c74-865f-773ad83db7a5@xxxxxxxxxx Signed-off-by: David Hildenbrand <david@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- --- a/mm/userfaultfd.c~mm-userfaultfd-rely-on-vma-vm_page_prot-in-uffd_wp_range-fix +++ a/mm/userfaultfd.c @@ -727,7 +727,7 @@ void uffd_wp_range(struct mm_struct *dst * to be write-protected as default whenever protection changes. * Try upgrading write permissions manually. */ - if (vma_wants_manual_pte_write_upgrade(dst_vma)) + if (!enable_wp && vma_wants_manual_pte_write_upgrade(dst_vma)) mm_cp_flags |= MM_CP_TRY_CHANGE_WRITABLE; tlb_gather_mmu(&tlb, dst_mm); change_protection(&tlb, dst_vma, start, start + len, vma->vm_page_prot, _ Patches currently in -mm which might be from david@xxxxxxxxxx are mm-hugetlb-fix-pte-marker-handling-in-hugetlb_change_protection.patch mm-hugetlb-fix-uffd-wp-handling-for-migration-entries-in-hugetlb_change_protection.patch mm-userfaultfd-enable-writenotify-while-userfaultfd-wp-is-enabled-for-a-vma.patch mm-userfaultfd-rely-on-vma-vm_page_prot-in-uffd_wp_range.patch mm-userfaultfd-rely-on-vma-vm_page_prot-in-uffd_wp_range-fix.patch mm-mprotect-drop-pgprot_t-parameter-from-change_protection.patch mm-mprotect-drop-pgprot_t-parameter-from-change_protection-fix.patch