lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20220719184959.3360032-1-Liam.Howlett@oracle.com>
Date:   Tue, 19 Jul 2022 18:50:01 +0000
From:   Liam Howlett <liam.howlett@...cle.com>
To:     "maple-tree@...ts.infradead.org" <maple-tree@...ts.infradead.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Hugh Dickins <hughd@...gle.com>
CC:     Yu Zhao <yuzhao@...gle.com>
Subject: [PATCH] mmap: Remove unroll from vma_expand()

Undoing the anon vma work is no necessary since it will be handled by
the caller in the freeing of the VMA, or in the OOM that is happening.

Fixes: d8bb385648a5 (mm/mmap: use advanced maple tree API for mmap_region())
Suggested-by:Hugh Dickins <hughd@...gle.com>
Signed-off-by: Liam R. Howlett <Liam.Howlett@...cle.com>
---
 mm/mmap.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/mm/mmap.c b/mm/mmap.c
index 139862557cc1..7440f250581d 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -670,7 +670,6 @@ inline int vma_expand(struct ma_state *mas, struct vm_area_struct *vma,
 	struct anon_vma *anon_vma = vma->anon_vma;
 	struct file *file = vma->vm_file;
 	bool remove_next = false;
-	bool anon_cloned = false;
 
 	if (next && (vma != next) && (end == next->vm_end)) {
 		remove_next = true;
@@ -682,7 +681,6 @@ inline int vma_expand(struct ma_state *mas, struct vm_area_struct *vma,
 			error = anon_vma_clone(vma, next);
 			if (error)
 				return error;
-			anon_cloned = true;
 		}
 	}
 
@@ -765,8 +763,6 @@ inline int vma_expand(struct ma_state *mas, struct vm_area_struct *vma,
 	return 0;
 
 nomem:
-	if (anon_cloned)
-		unlink_anon_vmas(vma);
 	return -ENOMEM;
 }
 
-- 
2.35.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ