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: <20140113223407.GP10038@linux.vnet.ibm.com>
Date:	Mon, 13 Jan 2014 14:34:07 -0800
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Oleg Nesterov <oleg@...hat.com>, Ingo Molnar <mingo@...nel.org>,
	linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
	Steven Rostedt <rostedt@...dmis.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH 1/1] lockdep: Kill held_lock->check and "int check" arg
 of __lock_acquire()

On Mon, Jan 13, 2014 at 06:28:33PM +0100, Peter Zijlstra wrote:
> On Mon, Jan 13, 2014 at 06:06:09PM +0100, Oleg Nesterov wrote:
> > On 01/12, Oleg Nesterov wrote:
> > >
> > > The "int check" argument of lock_acquire() and held_lock->check
> > > are misleading and unneeded. This is only used as a boolean, 2
> > > denotes "true", everything else is "false". And this boolean is
> > > always equal to prove_locking.
> > >
> > > The only exception is __lockdep_no_validate__ which should make
> > > this condition "false" in validate_chain().
> > 
> > And I missed mark_irqflags(),
> > 
> > > @@ -3136,7 +3130,7 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
> > >  	hlock->holdtime_stamp = lockstat_clock();
> > >  #endif
> > >
> > > -	if (check == 2 && !mark_irqflags(curr, hlock))
> > > +	if (prove_locking && !mark_irqflags(curr, hlock))
> > >  		return 0;
> > 
> > This change is not right, at least it is not equivalent.
> > 
> > And I just realized that rcu_lock_acquire() does lock_acquire(check => 1).
> > Probably we can mark rcu_lock_map's as __lockdep_no_validate__.
> 
> Can't, RCU needs its own classes. Otherwise it cannot tell which version
> of the RCU read lock its holding at just that moment.

Just confirming this.  RCU uses this to detected mismatches between
the rcu_read_lock() group and the rcu_dereference() group.

							Thanx, Paul

> > Anything else I missed?
> 
> Nothing springs to mind, but then, I totally missed the RCU thing too.
> 
> At the very least we can reduce check to a single bit.
> 

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