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]
Message-ID: <CAJZ5v0hx1yagWQYaHY-x=VMvw9cdZm=B88MPK=HyVOBVL7ANqg@mail.gmail.com>
Date: Wed, 5 Feb 2025 21:04:01 +0100
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Aboorva Devarajan <aboorvad@...ux.ibm.com>
Cc: rafael@...nel.org, viresh.kumar@...aro.org, zhenglifeng1@...wei.com, 
	linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org, gautam@...ux.ibm.com
Subject: Re: [PATCH 1/1] cpufreq: prevent NULL dereference in cpufreq_online

On Wed, Feb 5, 2025 at 7:14 PM Aboorva Devarajan <aboorvad@...ux.ibm.com> wrote:
>
> Ensure `cpufreq_driver->set_boost` is non-NULL before using it in
> `cpufreq_online` to prevent a potential NULL pointer dereference.
>
> Reported-by: Gautam Menghani <gautam@...ux.ibm.com>
> Closes: https://lore.kernel.org/all/c9e56c5f54cc33338762c94e9bed7b5a0d5de812.camel@linux.ibm.com/
> Fixes: dd016f379ebc ("cpufreq: Introduce a more generic way to set default per-policy boost flag")
> Suggested-by: Viresh Kumar <viresh.kumar@...aro.org>
> Signed-off-by: Aboorva Devarajan <aboorvad@...ux.ibm.com>
> ---
>  drivers/cpufreq/cpufreq.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index e0048856ecee..30ffbddc7ece 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -1571,7 +1571,8 @@ static int cpufreq_online(unsigned int cpu)
>                 policy->cdev = of_cpufreq_cooling_register(policy);
>
>         /* Let the per-policy boost flag mirror the cpufreq_driver boost during init */
> -       if (policy->boost_enabled != cpufreq_boost_enabled()) {
> +       if (cpufreq_driver->set_boost &&
> +           policy->boost_enabled != cpufreq_boost_enabled()) {
>                 policy->boost_enabled = cpufreq_boost_enabled();
>                 ret = cpufreq_driver->set_boost(policy, policy->boost_enabled);
>                 if (ret) {
> --

Applied as 6.14-rc material, thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ