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: <47440afc-1b76-4dff-8c72-427103d7184a@linaro.org>
Date: Wed, 3 Jul 2024 14:21:10 +0200
From: Daniel Lezcano <daniel.lezcano@...aro.org>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>,
 Linux PM <linux-pm@...r.kernel.org>
Cc: LKML <linux-kernel@...r.kernel.org>, "Rafael J. Wysocki"
 <rafael@...nel.org>, Lukasz Luba <lukasz.luba@....com>,
 Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
 Zhang Rui <rui.zhang@...el.com>, Shawn Guo <shawnguo@...nel.org>,
 Pengutronix Kernel Team <kernel@...gutronix.de>,
 Thara Gopinath <thara.gopinath@...il.com>,
 Thierry Reding <thierry.reding@...il.com>,
 Jonathan Hunter <jonathanh@...dia.com>, linux-wireless@...r.kernel.org,
 linux-tegra@...r.kernel.org
Subject: Re: [RESEND][PATCH v1 4/5] thermal: imx: Drop critical trip check
 from imx_set_trip_temp()

On 02/07/2024 16:43, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> 
> Because the IMX thermal driver does not flag its critical trip as
> writable, imx_set_trip_temp() will never be invoked for it and so the
> critical trip check can be dropped from there.

And as a rule of thumb, we should not allow writing the critical trip 
point temperature in the thermal core code.

> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> ---
>   drivers/thermal/imx_thermal.c |    9 ---------
>   1 file changed, 9 deletions(-)
> 
> Index: linux-pm/drivers/thermal/imx_thermal.c
> ===================================================================
> --- linux-pm.orig/drivers/thermal/imx_thermal.c
> +++ linux-pm/drivers/thermal/imx_thermal.c
> @@ -335,21 +335,12 @@ static int imx_set_trip_temp(struct ther
>   			     int temp)
>   {
>   	struct imx_thermal_data *data = thermal_zone_device_priv(tz);
> -	struct thermal_trip trip;
>   	int ret;
>   
>   	ret = pm_runtime_resume_and_get(data->dev);
>   	if (ret < 0)
>   		return ret;
>   
> -	ret = __thermal_zone_get_trip(tz, trip_id, &trip);
> -	if (ret)
> -		return ret;
> -
> -	/* do not allow changing critical threshold */
> -	if (trip.type == THERMAL_TRIP_CRITICAL)
> -		return -EPERM;
> -
>   	/* do not allow passive to be set higher than critical */
>   	if (temp < 0 || temp > trips[IMX_TRIP_CRITICAL].temperature)
>   		return -EINVAL;
> 
> 
> 

-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ