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: <70cbbf88-7c1e-44f4-8091-ee76944d2f6b@redhat.com>
Date: Fri, 3 Oct 2025 14:48:03 +0200
From: Jocelyn Falempe <jfalempe@...hat.com>
To: Francesco Valla <francesco@...la.it>,
 Javier Martinez Canillas <javierm@...hat.com>,
 Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
 Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
 David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>
Cc: dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/draw: fix color truncation in drm_draw_fill24

On 10/3/25 12:33, Francesco Valla wrote:
> The color parameter passed to drm_draw_fill24() was truncated to 16
> bits, leading to an incorrect color drawn to the target iosys_map.
> Fix this behavior, widening the parameter to 32 bits.
> 
Oh, you're right, my mistake.
Did you find this by using a 24bit hardware, or by looking at the code?

Reviewed-by: Jocelyn Falempe <jfalempe@...hat.com>

Best regards,

-- 

Jocelyn

> Fixes: 31fa2c1ca0b2 ("drm/panic: Move drawing functions to drm_draw")
> 
> Signed-off-by: Francesco Valla <francesco@...la.it>
> ---
>   drivers/gpu/drm/drm_draw.c          | 2 +-
>   drivers/gpu/drm/drm_draw_internal.h | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_draw.c b/drivers/gpu/drm/drm_draw.c
> index 9dc0408fbbeadbe8282a2d6b210e0bfb0672967f..5b956229c82fb6e232e3342705a226c8e14c8568 100644
> --- a/drivers/gpu/drm/drm_draw.c
> +++ b/drivers/gpu/drm/drm_draw.c
> @@ -127,7 +127,7 @@ EXPORT_SYMBOL(drm_draw_fill16);
>   
>   void drm_draw_fill24(struct iosys_map *dmap, unsigned int dpitch,
>   		     unsigned int height, unsigned int width,
> -		     u16 color)
> +		     u32 color)
>   {
>   	unsigned int y, x;
>   
> diff --git a/drivers/gpu/drm/drm_draw_internal.h b/drivers/gpu/drm/drm_draw_internal.h
> index f121ee7339dc11537f677c833f0ee94fe0e799cd..20cb404e23ea6263b535ea2b81b25f84c37be8a2 100644
> --- a/drivers/gpu/drm/drm_draw_internal.h
> +++ b/drivers/gpu/drm/drm_draw_internal.h
> @@ -47,7 +47,7 @@ void drm_draw_fill16(struct iosys_map *dmap, unsigned int dpitch,
>   
>   void drm_draw_fill24(struct iosys_map *dmap, unsigned int dpitch,
>   		     unsigned int height, unsigned int width,
> -		     u16 color);
> +		     u32 color);
>   
>   void drm_draw_fill32(struct iosys_map *dmap, unsigned int dpitch,
>   		     unsigned int height, unsigned int width,
> 
> ---
> base-commit: e406d57be7bd2a4e73ea512c1ae36a40a44e499e
> change-id: 20251003-drm_draw_fill24_fix-ea52d32a933d
> 
> Best regards,


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ