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] [thread-next>] [day] [month] [year] [list]
Message-ID: <a7213b69-f6ae-4975-8c8b-2783dbe9f9b3@gmx.de>
Date: Tue, 2 Dec 2025 19:28:43 +0100
From: Helge Deller <deller@....de>
To: Thorsten Blum <thorsten.blum@...ux.dev>,
 Chelsy Ratnawat <chelsyratnawat2001@...il.com>,
 Thomas Zimmermann <tzimmermann@...e.de>,
 Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
 Raag Jadav <raag.jadav@...el.com>
Cc: linux-fbdev@...r.kernel.org, dri-devel@...ts.freedesktop.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fbdev/pxafb: Fix multiple clamped values in
 pxafb_adjust_timing

On 12/2/25 19:15, Thorsten Blum wrote:
> The variables were never clamped because the return value of clamp_val()
> was not used. Fix this by assigning the clamped values, and use clamp()
> instead of clamp_val().
> 
> Cc: stable@...r.kernel.org
> Fixes: 3f16ff608a75 ("[ARM] pxafb: cleanup of the timing checking code")
> Signed-off-by: Thorsten Blum <thorsten.blum@...ux.dev>
> ---
>   drivers/video/fbdev/pxafb.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)

Thanks for the patch!
It looks good, so I'll include it in the fbdev tree.
Out of curiosity:
How did you notice? Do you actually have the hardware and tested it?

Helge 
> diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c
> index b96a8a96bce8..e418eee825fb 100644
> --- a/drivers/video/fbdev/pxafb.c
> +++ b/drivers/video/fbdev/pxafb.c
> @@ -419,12 +419,12 @@ static int pxafb_adjust_timing(struct pxafb_info *fbi,
>   	var->yres = max_t(int, var->yres, MIN_YRES);
>   
>   	if (!(fbi->lccr0 & LCCR0_LCDT)) {
> -		clamp_val(var->hsync_len, 1, 64);
> -		clamp_val(var->vsync_len, 1, 64);
> -		clamp_val(var->left_margin,  1, 255);
> -		clamp_val(var->right_margin, 1, 255);
> -		clamp_val(var->upper_margin, 1, 255);
> -		clamp_val(var->lower_margin, 1, 255);
> +		var->hsync_len = clamp(var->hsync_len, 1, 64);
> +		var->vsync_len = clamp(var->vsync_len, 1, 64);
> +		var->left_margin  = clamp(var->left_margin,  1, 255);
> +		var->right_margin = clamp(var->right_margin, 1, 255);
> +		var->upper_margin = clamp(var->upper_margin, 1, 255);
> +		var->lower_margin = clamp(var->lower_margin, 1, 255);
>   	}
>   
>   	/* make sure each line is aligned on word boundary */


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ