Re: + mm-start-tracking-vmas-with-maple-tree-fix.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> [220428 14:11]:
> On Thu, 28 Apr 2022 17:35:17 +0000 Liam Howlett <liam.howlett@xxxxxxxxxx> wrote:
> 
> > * Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> [220427 18:57]:
> > > 
> > > The patch titled
> > >      Subject: mm/mmap: fix __vma_adjust() memory leak
> > > has been added to the -mm tree.  Its filename is
> > >      mm-start-tracking-vmas-with-maple-tree-fix.patch
> > > 
> > > This patch should soon appear at
> > >     https://ozlabs.org/~akpm/mmots/broken-out/mm-start-tracking-vmas-with-maple-tree-fix.patch
> > > and later at
> > >     https://ozlabs.org/~akpm/mmotm/broken-out/mm-start-tracking-vmas-with-maple-tree-fix.patch
> > 
> > Both of these links are 404 and the patch does not seem to be in
> > linux-next 20220428.  Is there any chance this was missed?
> 
> We're in the process of gitifying the -mm tree and there were glitches.
> Hopefully next -next will sort this out.
> 
> Please review the mm-everything branch at
> git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm to check that
> everything has landed correctly.
> 

Okay, this patch is not applied to the correct line number in that tree.

mas_destroy() should be called at line 905 before the validate_mm(), not
at the start of the function.

Besides that, everything looks to be in order.

Thanks,
Liam
From 8d388d51e169e512b863d90e8d7ee203619dfbd4 Mon Sep 17 00:00:00 2001
From: "Liam R. Howlett" <Liam.Howlett@xxxxxxxxxx>
Date: Thu, 28 Apr 2022 15:46:56 -0400
Subject: [PATCH] mm/mmap: Fix mas_destroy() location in __vma_adjust()

Signed-off-by: Liam R. Howlett <Liam.Howlett@xxxxxxxxxx>
---
 mm/mmap.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mm/mmap.c b/mm/mmap.c
index 10948bb29887..d5d216a628d0 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -655,8 +655,6 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start,
 	MA_STATE(mas, &mm->mm_mt, 0, 0);
 	struct vm_area_struct *exporter = NULL, *importer = NULL;
 
-	mas_destroy(&mas);
-
 	if (next && !insert) {
 		if (end >= next->vm_end) {
 			/*
@@ -903,6 +901,7 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start,
 		uprobe_mmap(insert);
 	}
 
+	mas_destroy(&mas);
 	validate_mm(mm);
 
 	return 0;
-- 
2.35.1


[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux