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] [day] [month] [year] [list]
Date:	Sat, 06 Nov 2010 11:54:28 +0000
From:	Liam Girdwood <lrg@...mlogic.co.uk>
To:	Mattias Wallin <mattias.wallin@...ricsson.com>
Cc:	"broonie@...nsource.wolfsonmicro.com" 
	<broonie@...nsource.wolfsonmicro.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Linus WALLEIJ <linus.walleij@...ricsson.com>,
	Bengt JONSSON <bengt.g.jonsson@...ricsson.com>
Subject: Re: [PATCH] regulator: lock supply in regulator enable

On Thu, 2010-11-04 at 12:43 +0100, Mattias Wallin wrote:
> > Sorry, got a busy schedule atm. Can you give us your reasoning behind
> > why you think we need a lock here ?
> Yes, when we enter regulator_enable() we take the lock only for that specific regulator rdev->mutex
> and calls the locked function _regulator_enable().
> This locked function then checks if we have a supply and recursively calls the locked _regulator_enable() again but with the supply rdev as argument.
> The supply rdev regulator is however not locked at this stage, only the "original" supplied regulator is locked.
> So if we have two regulators with the same supply regulator trying to enable at approx. the same time they will both
> enter the _regulator_enable without locks and we could get a race condition.
> This would probably result in reference counting error and unbalanced regulator warnings.
> 
> In our system we make use the regulator hierarchy quite heavily.
> > 

Applied.

Thanks

Liam
-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

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