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  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]
Date:	Fri, 20 Sep 2013 15:05:16 +0530
From:	Viresh Kumar <viresh.kumar@...aro.org>
To:	Linus Walleij <linus.walleij@...aro.org>
Cc:	"Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>,
	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: Regression on cpufreq in v3.12-rc1

On 20 September 2013 14:19, Viresh Kumar <viresh.kumar@...aro.org> wrote:
> Hmm... Remember I told you last time that I have another way of fixing
> it up, probably we need that now..
>
> I wanted to add another variable to reflect if a cpufreq_driver is registered
> or not, and if not then return early from these routines..
>
> I will get that in now, please see if you can give it a try..
>
> But I am still surprised how are we reaching this place before your cpufreq
> driver gets registered..

Once we know what's going on in your system, please test attached patch
(Will send it separately once you have tested it):

commit 389fbc3c8ad7c339cd2d9572d73c355b7b967823
Author: Viresh Kumar <viresh.kumar@...aro.org>
Date:   Fri Sep 20 14:55:31 2013 +0530

    cpufreq: check cpufreq driver is valid and cpufreq isn't disabled
in cpufreq_get()

    cpufreq_get() can be called from external drivers which might not
be aware if
    cpufreq driver is registered or not. And so we should actually
check if cpufreq
    driver is registered or not and also if cpufreq is active or
disabled, at the
    beginning of cpufreq_get().

    Otherwise call to lock_policy_rwsem_read() might hit BUG_ON(!policy).

    Signed-off-by: Viresh Kumar <viresh.kumar@...aro.org>
---
 drivers/cpufreq/cpufreq.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 82ecbe3..db004a8 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1460,6 +1460,9 @@ unsigned int cpufreq_get(unsigned int cpu)
 {
        unsigned int ret_freq = 0;

+       if (cpufreq_disabled() || !cpufreq_driver)
+               return -ENOENT;
+
        if (!down_read_trylock(&cpufreq_rwsem))
                return 0;

Download attachment "0001-cpufreq-check-cpufreq-driver-is-valid-and-cpufreq-is.patch" of type "application/octet-stream" (1224 bytes)

Powered by blists - more mailing lists