From: Andrea Arcangeli Date: Tue, 10 Aug 2010 00:19:10 +0000 (-0700) Subject: rmap: resurrect page_address_in_vma anon_vma check X-Git-Tag: v2.6.36-rc1~433 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=21d0d443cdc1658a8c1484fdcece4803f0f96d0e;p=platform%2Fkernel%2Flinux-3.10.git rmap: resurrect page_address_in_vma anon_vma check With root anon-vma it's trivial to keep doing the usual check as in old-anon-vma code. Signed-off-by: Andrea Arcangeli Signed-off-by: Rik van Riel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/rmap.c b/mm/rmap.c index f5d6799..2f855ba 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -364,9 +364,10 @@ vma_address(struct page *page, struct vm_area_struct *vma) */ unsigned long page_address_in_vma(struct page *page, struct vm_area_struct *vma) { - if (PageAnon(page)) - ; - else if (page->mapping && !(vma->vm_flags & VM_NONLINEAR)) { + if (PageAnon(page)) { + if (vma->anon_vma->root != page_anon_vma(page)->root) + return -EFAULT; + } else if (page->mapping && !(vma->vm_flags & VM_NONLINEAR)) { if (!vma->vm_file || vma->vm_file->f_mapping != page->mapping) return -EFAULT;