--- x/kernel/fork.c +++ y/kernel/fork.c @@ -692,6 +692,8 @@ static __latent_entropy int dup_mmap(str for_each_vma(old_vmi, mpnt) { struct file *file; + vma_start_write(mpnt); + if (mpnt->vm_flags & VM_DONTCOPY) { vm_stat_account(mm, mpnt->vm_flags, -vma_pages(mpnt)); continue; --- x/mm/mmap.c +++ y/mm/mmap.c @@ -2805,6 +2805,7 @@ cannot_expand: if (vma_iter_prealloc(&vmi)) goto close_and_free_vma; + vma_start_write(vma); if (vma->vm_file) i_mmap_lock_write(vma->vm_file->f_mapping);