]> git.baikalelectronics.ru Git - kernel.git/commit
mm: fix potential anon_vma locking issue in mprotect()
authorMichel Lespinasse <walken@google.com>
Mon, 8 Oct 2012 23:30:01 +0000 (16:30 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 9 Oct 2012 07:22:28 +0000 (16:22 +0900)
commit56e685a5adcb07af73ed514c7a59e79a905926d5
tree4a9d68d4d730474dde75b1ffff106d7e3442aef1
parent94ee26315054c3a2fc2e895fef2cbcb97562fdfb
mm: fix potential anon_vma locking issue in mprotect()

Fix an anon_vma locking issue in the following situation:

- vma has no anon_vma
- next has an anon_vma
- vma is being shrunk / next is being expanded, due to an mprotect call

We need to take next's anon_vma lock to avoid races with rmap users (such
as page migration) while next is being expanded.

Signed-off-by: Michel Lespinasse <walken@google.com>
Reviewed-by: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/mmap.c