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-next>] [day] [month] [year] [list]
Date:   Tue,  2 Feb 2021 17:36:19 +0800
From:   Xuewen Yan <xuewen.yan94@...il.com>
To:     rjw@...ysocki.net, viresh.kumar@...aro.org
Cc:     linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
        xuewyan@...mail.com, Xuewen.Yan@...soc.com
Subject: [PATCH] cpufreq: Judging new_policy before update related_cpus

From: Xuewen Yan <xuewen.yan@...soc.com>

When the policy->related_cpus are all offline, and then
bring up one cpu, this time, if the ->online is NULL,
the code would update the ->related_cpus with ->cpus,
and now ->cpus is only one online cpu, as a result, the
->related_cpus is different from the origion ->related_cpus.

Signed-off-by: Xuewen Yan <xuewen.yan@...soc.com>
---
 drivers/cpufreq/cpufreq.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index d0a3525ce27f..3d512ac463a5 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1374,8 +1374,10 @@ static int cpufreq_online(unsigned int cpu)
 		if (ret)
 			goto out_exit_policy;
 
-		/* related_cpus should at least include policy->cpus. */
-		cpumask_copy(policy->related_cpus, policy->cpus);
+		if (new_policy) {
+			/* related_cpus should at least include policy->cpus. */
+			cpumask_copy(policy->related_cpus, policy->cpus);
+		}
 	}
 
 	down_write(&policy->rwsem);
-- 
2.29.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ