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: <20110724051744.GF2415@linux.vnet.ibm.com>
Date:	Sat, 23 Jul 2011 22:17:44 -0700
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Thomas Gleixner <tglx@...utronix.de>
Cc:	Peter Zijlstra <a.p.zijlstra@...llo.nl>, laijs@...fujitsu.com,
	darren@...art.com, rostedt@...dmis.org, mingo@...e.hu,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC] rtmutex: Permit rt_mutex_unlock() to be invoked
 with irqs disabled

On Sun, Jul 24, 2011 at 02:05:13AM +0200, Thomas Gleixner wrote:
> On Sun, 24 Jul 2011, Thomas Gleixner wrote:
> 
> > On Sat, 23 Jul 2011, Paul E. McKenney wrote:
> > 
> > > On Thu, Jul 21, 2011 at 01:32:48PM +0200, Peter Zijlstra wrote:
> > > > On Tue, 2011-07-19 at 13:14 -0700, Paul E. McKenney wrote:
> > > > > Because rcu_read_unlock() can be invoked with interrupts disabled, it can
> > > > > in turn invoke rt_mutex_unlock() with interrupts disabled.  This situation
> > > > > results in lockdep splats (https://lkml.org/lkml/2011/7/7/362) because the
> > > > > rt_mutex structure's ->lock_wait is acquired elsewhere without disabling
> > > > > interrupts, which can result in deadlocks.
> > > > > 
> > > > > This commit therefore changes the rt_mutex structure's ->lock_wait
> > > > > acquisitions to disable interrupts.
> > > > > 
> > > > > An alternative fix is to prohibit invoking rcu_read_unlock() with
> > > > > interrupts disabled unless the entire preceding RCU read-side critical
> > > > > section has run with interrupts disabled.  However, there is already
> > > > > at least one case in mainline where this potential rule is violated,
> > > > > and there might well be many more.  These would likely be found one at
> > > > > a time using the lockdep-water-torture method, hence the alternative
> > > > > fix in the form of this commit.
> > > > 
> > > > Thomas, I'm inclined to merge this, any objections?
> > > 
> > > FWIW, it has been passing tests here.
> > 
> > If it's only the unlock path, I'm fine with that change.
> > 
> > Acked-by-me
> 
> Hrmpft. That's requiring all places to take the lock irq safe. Not
> really amused. For -RT that's a hotpath and we can really do without
> the irq fiddling there. That needs a bit more thought.

Indeed...  If I make only some of the lock acquisitions irq safe, lockdep
will yell at me.  And rightfully so, as that could result in deadlock.

So, what did you have in mind?

							Thanx, Paul
--
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