mm: lock a vma before stack expansion
authorSuren Baghdasaryan <surenb@google.com>
Sat, 8 Jul 2023 19:12:10 +0000 (12:12 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 8 Jul 2023 21:08:02 +0000 (14:08 -0700)
commitc137381f71aec755fbf47cd4e9bd4dce752c054c
tree13f8dc7926e331b638e943a6759f9be7c87b7484
parent7fcd473a6455450428795d20db7afd2691c92336
mm: lock a vma before stack expansion

With recent changes necessitating mmap_lock to be held for write while
expanding a stack, per-VMA locks should follow the same rules and be
write-locked to prevent page faults into the VMA being expanded. Add
the necessary locking.

Cc: stable@vger.kernel.org
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/mmap.c