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: <20240730082725.7477-1-hanzj.it@gmail.com>
Date: Tue, 30 Jul 2024 16:27:25 +0800
From: "zhijun.han" <hanzj.it@...il.com>
To: brauner@...nel.org,
	linux-kernel@...r.kernel.org
Cc: hanzj.it@...il.com
Subject: [PATCH] fork: Using oldmm replace current->mm for dup_mm

In the current implementation of copy_mm(),there is a line
initializes `oldmm = current->mm` before dup_mm.
This means that there is no longer a need to use current->mm for
dup_mm.

Signed-off-by: zhijun.han <hanzj.it@...il.com>
---
 kernel/fork.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/fork.c b/kernel/fork.c
index 41771bde2ce7..833557bb0187 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1720,7 +1720,7 @@ static int copy_mm(unsigned long clone_flags, struct task_struct *tsk)
 		mmget(oldmm);
 		mm = oldmm;
 	} else {
-		mm = dup_mm(tsk, current->mm);
+		mm = dup_mm(tsk, oldmm);
 		if (!mm)
 			return -ENOMEM;
 	}
-- 
2.45.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ