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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1427207914.2412.17.camel@stgolabs.net>
Date:	Tue, 24 Mar 2015 07:38:34 -0700
From:	Davidlohr Bueso <dave@...olabs.net>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	Konstantin Khlebnikov <khlebnikov@...dex-team.ru>,
	linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: fix lockdep build in rcu-protected get_mm_exe_file()

On Mon, 2015-03-23 at 20:10 +0100, Oleg Nesterov wrote:
> "atomic_read(&mm->mm_users) <= 1" looks a bit more "safe". But again,
> I won't insist.

Agreed, it is nicer to do that check, but I have no strong preference
either, perhaps Konstantin or akpm do. Anyway, here's the change that
can be folded in if you guys want to.

Thanks.

8<-------------------------------------------------
diff --git a/kernel/fork.c b/kernel/fork.c
index 98858b5..0c3de2b 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -697,7 +697,7 @@ EXPORT_SYMBOL_GPL(mmput);
 void set_mm_exe_file(struct mm_struct *mm, struct file *new_exe_file)
 {
 	struct file *old_exe_file = rcu_dereference_protected(mm->exe_file,
-			!atomic_read(&mm->mm_users) || current->in_execve);
+			atomic_read(&mm->mm_users) <= 1);
 
 	if (new_exe_file)
 		get_file(new_exe_file);


--
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