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: <CAJZ5v0jZKfj=MSfFDjk3gnL0rUT08-ixev-y5p9KvwDCpGx3+g@mail.gmail.com>
Date: Wed, 24 Sep 2025 22:11:28 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
Cc: daniel.lezcano@...aro.org, lukasz.luba@....com, linux-pm@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] thermal: intel: int340x: Power Slider: Validate
 slider_balance range

On Wed, Sep 24, 2025 at 10:00 PM Rafael J. Wysocki <rafael@...nel.org> wrote:
>
> On Tue, Sep 23, 2025 at 10:56 PM Srinivas Pandruvada
> <srinivas.pandruvada@...ux.intel.com> wrote:
> >
> > When the module parameter slider_balance is set to the performance
> > slider value of 0, the SoC slider profile switches to performance mode.
> > This can cause the Linux power-profiles-daemon to change the system
> > power mode to performance from balanced mode. This happens when there
> > is only one platform profile is registered as there will be no conflict
> > with other platform profiles.
> >
> > Same issue occurs when the slider_balance is set to the power-saver
> > slider value.
> >
> > Prevent module parameter slider_balance from overlapping with
> > performance and power-saver slider values by adding range validation.
> > Return an error when an invalid value is provided.
> >
> > Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
> > ---
> > Rebased on top of bleeding-edge branch of linux-pm
> >
> >  .../intel/int340x_thermal/processor_thermal_soc_slider.c       | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/thermal/intel/int340x_thermal/processor_thermal_soc_slider.c b/drivers/thermal/intel/int340x_thermal/processor_thermal_soc_slider.c
> > index 20d70cb01542..49ff3bae7271 100644
> > --- a/drivers/thermal/intel/int340x_thermal/processor_thermal_soc_slider.c
> > +++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_soc_slider.c
> > @@ -67,7 +67,8 @@ static int slider_def_balance_set(const char *arg, const struct kernel_param *kp
> >
> >         ret = kstrtou8(arg, 16, &slider_val);
> >         if (!ret) {
> > -               if (slider_val > SOC_SLIDER_VALUE_MAXIMUM)
> > +               if (slider_val <= slider_values[SOC_POWER_SLIDER_PERFORMANCE] ||
> > +                   slider_val >= slider_values[SOC_POWER_SLIDER_POWERSAVE])
> >                         return -EINVAL;
> >
> >                 slider_balanced_param = slider_val;
> > --
>
> Applied, thanks!
>
> I'm wondering though what happens if slider_balance is set to
> SOC_SLIDER_VALUE_BALANCE and there is no other platform profile
> driver. Will it cause the demon to switch over to the "balanced"
> profile?

Never mind, slider_balance is only used when the profile is "balanced".

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ