]> 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, 7 Sep 2012 00:23:41 +0000 (10:23 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 10 Sep 2012 06:18:03 +0000 (16:18 +1000)
commit6e0d2cfb3e7582b0fd4d2644fa0f2627874682d1
tree8ca7a5fcf9dfe4783986d0665794356b3f8a090e
parentea6e55c31295ec74f5fbf6aa5dfc4f540e1acbef
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>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/mmap.c