]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm: fix potential anon_vma locking issue in mprotect()
authorMichel Lespinasse <walken@google.com>
Thu, 13 Sep 2012 00:58:42 +0000 (10:58 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 19 Sep 2012 05:30:05 +0000 (15:30 +1000)
commit480cf86105170f2cb03be0ea954b9ceac5f6384d
tree770d9921728ceab08d69fb400236cd2dfa8eabd1
parent3095ea580bd263a2ad70f399d40c2987e972dc85
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