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: <53DF7BC4.9070500@redhat.com>
Date:	Mon, 04 Aug 2014 08:25:40 -0400
From:	Prarit Bhargava <prarit@...hat.com>
To:	Viresh Kumar <viresh.kumar@...aro.org>
CC:	Stephen Boyd <sboyd@...eaurora.org>,
	Saravana Kannan <skannan@...eaurora.org>,
	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Lenny Szubowicz <lszubowi@...hat.com>,
	"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	Robert Schöne <robert.schoene@...dresden.de>
Subject: Re: [PATCH] cpufreq, store_scaling_governor requires policy->rwsem
 to be held for duration of changing governors [v2]



On 08/04/2014 06:36 AM, Viresh Kumar wrote:
> Sorry for the delay guys, was away :(
> 
>>
>>   Possible unsafe locking scenario:
>>
>>         CPU0                    CPU1
>>         ----                    ----
>>    lock(&policy->rwsem);
>>                                 lock(s_active#9);
>>                                 lock(&policy->rwsem);
>>    lock(s_active#9);
>>
> 
> Thanks for coming to my rescue Stephen :), I was quite sure I got this
> with ondemand
> as well..

Yeah, I'm confused by it a bit because I wasn't able to reproduce it.  But I've
got some pretty clear instructions on how to do it.

> 
> I will be looking very closely at the code now to see what's going wrong.
> And btw, does anybody here has the exact understanding of why this
> lockdep does happen? I mean what was the real problem for which we

The issue is the collision between the setup & teardown of the policy's governor
sysfs files.

On creation the kernel does:

down_write(&policy->rwsem)
mutex_lock(kernfs_mutex) <- note this is similar to the "old" sysfs_mutex.

The opposite happens on a governor switch, specifically the existing governor's
exit, and then we get a lockdep warning.

I tried to reproduce with the instructions but was unable to ... ut that was on
Friday ;) and I'm going to try again this morning.  I've also ping'd some of the
engineers here in the office who are working on ARM to get access to a system to
do further analysis and testing.

I'll ping back later in the day with some results.

Sorry I don't have a better answer or solution yet, Viresh.

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