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]
Date:	Thu, 16 Jan 2014 19:09:44 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...nel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Steven Rostedt <rostedt@...dmis.org>,
	Paul McKenney <paulmck@...ux.vnet.ibm.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Alan Stern <stern@...land.harvard.edu>
Subject: Re: check && lockdep_no_validate (Was: lockdep: Introduce wait-type
 checks)

On Thu, Jan 16, 2014 at 06:43:48PM +0100, Oleg Nesterov wrote:
> But with or without this change the following code
> 
> 		static DEFINE_MUTEX(m1);
> 		static DEFINE_MUTEX(mx);
> 
> 		lockdep_set_novalidate_class(&mx);
> 
> 		// m1 -> mx
> 		mutex_lock(&m1);
> 		mutex_lock(&mx);
> 		mutex_unlock(&mx);
> 		mutex_unlock(&m1);
> 
> 		// mx -> m1 ; should trigger the warning ???
> 		mutex_lock(&mx);
> 		mutex_lock(&m1);
> 		mutex_unlock(&m1);
> 		mutex_unlock(&mx);
> 
> doesn't trigger the warning too. This is correct because
> lockdep_set_novalidate_class() means, well, no-validate.
> The question is: do we really want to avoid all validations?

Good question.

> Why lockdep_set_novalidate_class() was added? Unlees I missed
> something the problem is that (say) __driver_attach() can take
> the "same" lock twice, drivers/base/ lacks annotations.

Indeed, the driver model locking always slips my mind but yes its
creative. Alan Stern seems to have a good grasp on it though.

> Perhaps we should change the meaning of lockdep_set_novalidate_class?
> (perhaps with rename). What do you think about the patch below?
> 
> With this patch __lockdep_no_validate__ means "automatically nested",

Yes, I suppose that might work, it would allow some validation.

> although I have to remind I can hardly understand the code I am
> trying to change ;)

You don't seem to be doing too badly ;-)
--
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