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]
Date:   Wed, 9 May 2018 15:16:20 +0530
From:   Viresh Kumar <viresh.kumar@...aro.org>
To:     "Rafael J. Wysocki" <rjw@...ysocki.net>
Cc:     linux-pm@...r.kernel.org, Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        claudio@...dence.eu.com, patrick.bellasi@....com,
        juri.lelli@...hat.com, joelaf@...gle.com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] cpufreq: schedutil: Avoid using invalid next_freq

On 09-05-18, 11:44, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> 
> If the next_freq field of struct sugov_policy is set to UINT_MAX,
> it shouldn't be used for updating the CPU frequency (this is a
> special "invalid" value), but after commit b7eaf1aab9f8 (cpufreq:
> schedutil: Avoid reducing frequency of busy CPUs prematurely) it
> may be passed as the new frequency to sugov_update_commit() in
> sugov_update_single().
> 
> Fix that by adding an extra check for the special UINT_MAX value
> of next_freq to sugov_update_single().
> 
> Fixes: b7eaf1aab9f8 (cpufreq: schedutil: Avoid reducing frequency of busy CPUs prematurely)
> Reported-by: Viresh Kumar <viresh.kumar@...aro.org>
> Cc: 4.12+ <stable@...r.kernel.org> # 4.12+
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> ---
>  kernel/sched/cpufreq_schedutil.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> Index: linux-pm/kernel/sched/cpufreq_schedutil.c
> ===================================================================
> --- linux-pm.orig/kernel/sched/cpufreq_schedutil.c
> +++ linux-pm/kernel/sched/cpufreq_schedutil.c
> @@ -305,7 +305,8 @@ static void sugov_update_single(struct u
>  	 * Do not reduce the frequency if the CPU has not been idle
>  	 * recently, as the reduction is likely to be premature then.
>  	 */
> -	if (busy && next_f < sg_policy->next_freq) {
> +	if (busy && next_f < sg_policy->next_freq &&
> +	    sg_policy->next_freq != UINT_MAX) {
>  		next_f = sg_policy->next_freq;
>  
>  		/* Reset cached freq as next_freq has changed */

Acked-by: Viresh Kumar <viresh.kumar@...aro.org>

-- 
viresh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ