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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080308.161105.253167431.xiyou.wangcong@gmail.com>
Date:	Sat, 08 Mar 2008 16:11:05 +0800 (CST)
From:	WANG Cong <xiyou.wangcong@...il.com>
To:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Cc:	Ingo Molnar <mingo@...e.hu>, "G. Vaughan" <gvaughan@....nasa.gov>,
	Andrew Morton <akpm@...l.org>
Subject: [PATCH] Fix check after use in kernel/exit.c


mm_release won't check the mm_struct pointer, so it should
be checked before this call.

This patch was first posted here[1], and I don't know
why it was not accepted yet.

Thanks to "G. Vaughan" to remind me about this.

1. http://lkml.org/lkml/2007/11/15/520

Cc: Ingo Molnar <mingo@...e.hu>
Cc: "G. Vaughan" <gvaughan@....nasa.gov>
Signed-off-by: WANG Cong <xiyou.wangcong@...il.com>

---
 kernel/exit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/exit.c b/kernel/exit.c
index cd20bf0..0cb9cce 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -582,9 +582,9 @@ static void exit_mm(struct task_struct * tsk)
 {
 	struct mm_struct *mm = tsk->mm;
 
-	mm_release(tsk, mm);
 	if (!mm)
 		return;
+	mm_release(tsk, mm);
 	/*
 	 * Serialize with any possible pending coredump.
 	 * We must hold mmap_sem around checking core_waiters
-- 
1.5.2.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ