]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/mmap: prevent pagefault handler from racing with mmu_notifier registration
authorSuren Baghdasaryan <surenb@google.com>
Mon, 23 May 2022 16:40:59 +0000 (09:40 -0700)
committerSuren Baghdasaryan <surenb@google.com>
Wed, 23 Nov 2022 02:09:46 +0000 (02:09 +0000)
commite611b0a9a274ab3f65647eafee410b5b6da56ea8
tree0d0223c66d869a4fc9a9c28e10754e83afdbeed9
parent575073ac405940c46c0d8eebe411d7a770e03038
mm/mmap: prevent pagefault handler from racing with mmu_notifier registration

Page fault handlers might need to fire MMU notifications while a new
notifier is being registered. Modify mm_take_all_locks to write-lock all
VMAs and prevent this race with fault handlers that would hold VMA locks.
VMAs are locked before i_mmap_rwsem and anon_vma to keep the same
locking order as in page fault handlers.

Signed-off-by: Suren Baghdasaryan <surenb@google.com>
mm/mmap.c