]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm: fix potential anon_vma locking issue in mprotect()
authorMichel Lespinasse <walken@google.com>
Fri, 28 Sep 2012 00:19:19 +0000 (10:19 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 5 Oct 2012 04:00:52 +0000 (14:00 +1000)
commit7afffd18045b4dc57ec1a0b8b49201ce2c554724
tree7faace7bd9f3f7dc9317a511231a60f91b8bc7a7
parent2bab6ebc805480f9b4c572e7fe6e13c9f62cd7d9
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>
mm/mmap.c