Message ID | 20221018124949.44384051d19a.I7b85b7dd326d2d078dabdd4ae40c35dc4ee1f3bc@changeid |
---|---|
State | Accepted |
Headers | show |
Series | [v3] um: protect VMA iteration | expand |
On 18/10/2022 11:49, Johannes Berg wrote: > From: Johannes Berg <johannes.berg@intel.com> > > 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> > --- > v2: use mmap_read_lock() > v3: umm, yeah I'm an idiot, tested without rebuilding Happens even to the best of us. > --- > arch/um/kernel/tlb.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c > index ad449173a1a1..fa43bcd9ba0b 100644 > --- a/arch/um/kernel/tlb.c > +++ b/arch/um/kernel/tlb.c > @@ -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); > } Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com>
diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c index ad449173a1a1..fa43bcd9ba0b 100644 --- a/arch/um/kernel/tlb.c +++ b/arch/um/kernel/tlb.c @@ -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); }