Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Suren Baghdasaryan and committed by
Linus Torvalds
c137381f 7fcd473a

+4
+4
mm/mmap.c
··· 1977 1977 return -ENOMEM; 1978 1978 } 1979 1979 1980 + /* Lock the VMA before expanding to prevent concurrent page faults */ 1981 + vma_start_write(vma); 1980 1982 /* 1981 1983 * vma->vm_start/vm_end cannot change under us because the caller 1982 1984 * is required to hold the mmap_lock in read mode. We need the ··· 2066 2064 return -ENOMEM; 2067 2065 } 2068 2066 2067 + /* Lock the VMA before expanding to prevent concurrent page faults */ 2068 + vma_start_write(vma); 2069 2069 /* 2070 2070 * vma->vm_start/vm_end cannot change under us because the caller 2071 2071 * is required to hold the mmap_lock in read mode. We need the