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: <CAPDyKFr7KC3yYUWw9Ncs_W3WPYqJ2e2E__XOxUZ4hay=8F6Xkg@mail.gmail.com>
Date: Tue, 27 Jan 2026 15:27:25 +0100
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Gabor Juhos <j4g8y7@...il.com>
Cc: Konrad Dybcio <konradybcio@...nel.org>, Bjorn Andersson <andersson@...nel.org>, 
	linux-arm-msm@...r.kernel.org, linux-pm@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] pmdomain: qcom: rpmpd: fix off-by-one error in clamping
 to the highest state

On Thu, 22 Jan 2026 at 18:20, Gabor Juhos <j4g8y7@...il.com> wrote:
>
> As it is indicated by the comment, the rpmpd_aggregate_corner() function
> tries to clamp the state to the highest corner/level supported by the
> given power domain, however the calculation of the highest state contains
> an off-by-one error.
>
> The 'max_state' member of the 'rpmpd' structure indicates the highest
> corner/level, and as such it does not needs to be decremented.
>
> Change the code to use the 'max_state' value directly to avoid the error.
>
> Fixes: 98c8b3efacae ("soc: qcom: rpmpd: Add sync_state")
> Signed-off-by: Gabor Juhos <j4g8y7@...il.com>

Applied for fixes and by adding a stable tag, thanks!

Kind regards
Uffe


> ---
>  drivers/pmdomain/qcom/rpmpd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pmdomain/qcom/rpmpd.c b/drivers/pmdomain/qcom/rpmpd.c
> index f8580ec0f73785544aeb6f686438f39b477d134d..98ab4f9ea9bff431614739f37cd32b7b3bb407e4 100644
> --- a/drivers/pmdomain/qcom/rpmpd.c
> +++ b/drivers/pmdomain/qcom/rpmpd.c
> @@ -1001,7 +1001,7 @@ static int rpmpd_aggregate_corner(struct rpmpd *pd)
>
>         /* Clamp to the highest corner/level if sync_state isn't done yet */
>         if (!pd->state_synced)
> -               this_active_corner = this_sleep_corner = pd->max_state - 1;
> +               this_active_corner = this_sleep_corner = pd->max_state;
>         else
>                 to_active_sleep(pd, pd->corner, &this_active_corner, &this_sleep_corner);
>
>
> ---
> base-commit: 95fad101a21d31b4facd1b9e0713bba1c517db6e
> change-id: 20260122-qcom-rpmpd-clamp-fix-060fcda9cd74
>
> Best regards,
> --
> Gabor Juhos <j4g8y7@...il.com>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ