diff options
-rw-r--r-- | mm/memory.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/mm/memory.c b/mm/memory.c index 8c8420934d60..f6f93e5b6b02 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -875,12 +875,8 @@ copy_nonpresent_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm, return -EBUSY; return -ENOENT; } else if (is_pte_marker_entry(entry)) { - /* - * We're copying the pgtable should only because dst_vma has - * uffd-wp enabled, do sanity check. - */ - WARN_ON_ONCE(!userfaultfd_wp(dst_vma)); - set_pte_at(dst_mm, addr, dst_pte, pte); + if (userfaultfd_wp(dst_vma)) + set_pte_at(dst_mm, addr, dst_pte, pte); return 0; } if (!userfaultfd_wp(dst_vma)) |