diff options
author | Rik van Riel <riel@redhat.com> | 2010-04-05 18:13:33 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-04-05 18:15:51 +0200 |
commit | 4946d54cb55e86a156216fcfeed5568514b0830f (patch) | |
tree | a27a670f2cbe7d689588af24c6c9cda82690c7c2 /mm | |
parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 (diff) | |
download | linux-4946d54cb55e86a156216fcfeed5568514b0830f.tar.xz linux-4946d54cb55e86a156216fcfeed5568514b0830f.zip |
rmap: fix anon_vma_fork() memory leak
Fix a memory leak in anon_vma_fork(), where we fail to tear down the
anon_vmas attached to the new VMA in case setting up the new anon_vma
fails.
This bug also has the potential to leave behind anon_vma_chain structs
with pointers to invalid memory.
Reported-by: Minchan Kim <minchan.kim@gmail.com>
Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/rmap.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/mm/rmap.c b/mm/rmap.c index fcd593c9c997..eaa7a09eb72e 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -232,6 +232,7 @@ int anon_vma_fork(struct vm_area_struct *vma, struct vm_area_struct *pvma) out_error_free_anon_vma: anon_vma_free(anon_vma); out_error: + unlink_anon_vmas(vma); return -ENOMEM; } |