diff --git a/mm/mmap.c b/mm/mmap.c index 059c0fb25099..74e96a144b44 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2804,6 +2804,8 @@ cannot_expand: if (vma->vm_file) i_mmap_lock_write(vma->vm_file->f_mapping); + /* Lock the VMA since it is modified after insertion into VMA tree */ + vma_start_write(vma); vma_iter_store(&vmi, vma); mm->map_count++; if (vma->vm_file) {