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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110322223702.GO14675@home.goodmis.org>
Date:	Tue, 22 Mar 2011 18:37:02 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	David Collins <collinsd@...eaurora.org>
Cc:	Liam Girdwood <lrg@...mlogic.co.uk>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>,
	linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: Deadlock scenario in regulator core

On Tue, Mar 22, 2011 at 03:02:01PM -0700, David Collins wrote:
> Assume that A has already called regulator_enable for S1 some time in the
> past.
> 
> Consumer A thread execution:
> 	regulator_disable(S1)
> 	mutex_lock(S1)
> 	_regulator_disable(S1)
> 	_notifier_call_chain(S1)
> 	mutex_lock(L2)
> 
> Consumer B thread execution:
> 	regulator_enable(L2)
> 	mutex_lock(L2)
> 	_regulator_enable(L2)
> 	mutex_lock(S1)
> 
> The locks for S1 and L2 are taken in opposite orders in the two threads;
> therefore, it is possible to achieve deadlock.  I am not sure about the
> best way to resolve this situation.  Is there a correctness requirement
> that regulator_enable holds the child regulator's lock when it attempts to
> enable the parent regulator?  Likewise, is the lock around
> _notifier_call_chain required?

I'm curious, if you had enabled lockdep, do you get a warning? If not,
why not?

Thanks,

-- Steve

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