[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100924162618.360011635@clark.site>
Date: Fri, 24 Sep 2010 09:24:28 -0700
From: Greg KH <gregkh@...e.de>
To: linux-kernel@...r.kernel.org, stable@...nel.org
Cc: stable-review@...nel.org, torvalds@...ux-foundation.org,
akpm@...ux-foundation.org, alan@...rguk.ukuu.org.uk,
Andrea Arcangeli <aarcange@...hat.com>,
Johannes Weiner <jweiner@...hat.com>,
Rik van Riel <riel@...hat.com>,
Hugh Dickins <hughd@...gle.com>,
Marcelo Tosatti <mtosatti@...hat.com>
Subject: [40/80] mmap: call unlink_anon_vmas() in __split_vma() in case of error
2.6.35-stable review patch. If anyone has any objections, please let us know.
------------------
From: Andrea Arcangeli <aarcange@...hat.com>
commit 2aeadc30de45a72648f271603203ab392b80f607 upstream.
If __split_vma fails because of an out of memory condition the
anon_vma_chain isn't teardown and freed potentially leading to rmap walks
accessing freed vma information plus there's a memleak.
Signed-off-by: Andrea Arcangeli <aarcange@...hat.com>
Acked-by: Johannes Weiner <jweiner@...hat.com>
Acked-by: Rik van Riel <riel@...hat.com>
Acked-by: Hugh Dickins <hughd@...gle.com>
Cc: Marcelo Tosatti <mtosatti@...hat.com>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@...ux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
---
mm/mmap.c | 1 +
1 file changed, 1 insertion(+)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1997,6 +1997,7 @@ static int __split_vma(struct mm_struct
removed_exe_file_vma(mm);
fput(new->vm_file);
}
+ unlink_anon_vmas(new);
out_free_mpol:
mpol_put(pol);
out_free_vma:
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists