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, 21 Sep 2013 11:21:14 +0530
From:	"Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>
To:	Viresh Kumar <viresh.kumar@...aro.org>
CC:	rjw@...k.pl, linaro-kernel@...ts.linaro.org, patches@...aro.org,
	cpufreq@...r.kernel.org, linux-pm@...r.kernel.org,
	linux-kernel@...r.kernel.org, linus.walleij@...aro.org
Subject: Re: [PATCH] cpufreq: check cpufreq driver is valid and cpufreq isn't
 disabled in cpufreq_get()

On 09/20/2013 10:37 PM, Viresh Kumar wrote:
> 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).
> 
> Reported-and-Tested-by: Linus Walleij <linus.walleij@...aro.org>
> Signed-off-by: Viresh Kumar <viresh.kumar@...aro.org>
> ---

Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@...ux.vnet.ibm.com>

Regards,
Srivatsa S. Bhat

> 
> For 3.12.
> 
>  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;
> 

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