um: protect VMA iteration
authorJohannes Berg <johannes.berg@intel.com>
Tue, 18 Oct 2022 10:49:49 +0000 (12:49 +0200)
committerRichard Weinberger <richard@nod.at>
Wed, 1 Feb 2023 21:11:27 +0000 (22:11 +0100)
Due to changes in the iteration, there are now lockdep
checks indicating that we're missing locking here. Add
the missing locking where it's needed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
arch/um/kernel/tlb.c

index ad449173a1a1cdf20f3973fdfea96539392bc343..fa43bcd9ba0b6f7e1715687197cb894245fa04d8 100644 (file)
@@ -597,6 +597,8 @@ void force_flush_all(void)
        struct vm_area_struct *vma;
        VMA_ITERATOR(vmi, mm, 0);
 
+       mmap_read_lock(mm);
        for_each_vma(vmi, vma)
                fix_range(mm, vma->vm_start, vma->vm_end, 1);
+       mmap_read_unlock(mm);
 }