diff --git a/mm/memory.c b/mm/memory.c index 83aef222f11b3f1d847279e13f43358566a22b43..c467102a5cbc5de5ab2ea4dff740f2611c1124a4 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1022,7 +1022,7 @@ copy_one_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm, * If it's a COW mapping, write protect it both * in the parent and the child */ - if (is_cow_mapping(vm_flags)) { + if (is_cow_mapping(vm_flags) && pte_write(pte)) { ptep_set_wrprotect(src_mm, addr, src_pte); pte = pte_wrprotect(pte); }