All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged mm-stable] mmap-fix-copy_vma-failure-path.patch removed from -mm tree
@ 2022-10-12 22:57 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2022-10-12 22:57 UTC (permalink / raw)
  To: mm-commits, lukas.bulwahn, Liam.Howlett, liam.howlett, akpm


The quilt patch titled
     Subject: mmap: fix copy_vma() failure path
has been removed from the -mm tree.  Its filename was
     mmap-fix-copy_vma-failure-path.patch

This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Liam Howlett <liam.howlett@oracle.com>
Subject: mmap: fix copy_vma() failure path
Date: Tue, 11 Oct 2022 20:36:51 +0000

The anon vma was not unlinked and the file was not closed in the failure
path when the machine runs out of memory during the maple tree
modification.  This caused a memory leak of the anon vma chain and vma
since neither would be freed.

Link: https://lkml.kernel.org/r/20221011203621.1446507-1-Liam.Howlett@oracle.com
Fixes: 524e00b36e8c ("mm: remove rb tree")
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Reported-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Tested-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/mmap.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/mm/mmap.c~mmap-fix-copy_vma-failure-path
+++ a/mm/mmap.c
@@ -3240,6 +3240,11 @@ struct vm_area_struct *copy_vma(struct v
 out_vma_link:
 	if (new_vma->vm_ops && new_vma->vm_ops->close)
 		new_vma->vm_ops->close(new_vma);
+
+	if (new_vma->vm_file)
+		fput(new_vma->vm_file);
+
+	unlink_anon_vmas(new_vma);
 out_free_mempol:
 	mpol_put(vma_policy(new_vma));
 out_free_vma:
_

Patches currently in -mm which might be from liam.howlett@oracle.com are

mm-mmap-preallocate-maple-nodes-for-brk-vma-expansion.patch


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

only message in thread, other threads:[~2022-10-12 22:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-12 22:57 [merged mm-stable] mmap-fix-copy_vma-failure-path.patch removed from -mm tree Andrew Morton

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.