All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged] mm-fix-potential-anon_vma-locking-issue-in-mprotect.patch removed from -mm tree
@ 2012-10-09 18:08 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2012-10-09 18:08 UTC (permalink / raw)
  To: walken, aarcange, hughd, mm-commits


The patch titled
     Subject: mm: fix potential anon_vma locking issue in mprotect()
has been removed from the -mm tree.  Its filename was
     mm-fix-potential-anon_vma-locking-issue-in-mprotect.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Michel Lespinasse <walken@google.com>
Subject: 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 |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff -puN mm/mmap.c~mm-fix-potential-anon_vma-locking-issue-in-mprotect mm/mmap.c
--- a/mm/mmap.c~mm-fix-potential-anon_vma-locking-issue-in-mprotect
+++ a/mm/mmap.c
@@ -573,8 +573,12 @@ again:			remove_next = 1 + (end > next->
 	 */
 	if (vma->anon_vma && (importer || start != vma->vm_start)) {
 		anon_vma = vma->anon_vma;
+		VM_BUG_ON(adjust_next && next->anon_vma &&
+			  anon_vma != next->anon_vma);
+	} else if (adjust_next && next->anon_vma)
+		anon_vma = next->anon_vma;
+	if (anon_vma)
 		anon_vma_lock(anon_vma);
-	}
 
 	if (root) {
 		flush_dcache_mmap_lock(mapping);
_

Patches currently in -mm which might be from walken@google.com are

origin.patch
prio_tree-remove-fix.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-10-09 18:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-09 18:08 [merged] mm-fix-potential-anon_vma-locking-issue-in-mprotect.patch removed from -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.