Hi

Am 22.06.26 um 18:10 schrieb Thierry Reding:
On Mon, Jun 22, 2026 at 03:19:38PM +0200, Thomas Zimmermann wrote:
Validate the computed stride against the maximum value INT_MAX.

Signed-off-by: Thomas Zimmermann <[email protected]>
Fixes: 7bfa5c7b28d6 ("drm/simpledrm: Compute linestride with 
drm_format_info_min_pitch()")
Cc: <[email protected]> # v6.1+
---
  drivers/gpu/drm/sysfb/simpledrm.c | 10 ++++++++--
  1 file changed, 8 insertions(+), 2 deletions(-)
Ugh... I have a hard time imagining that we'd ever exceed INT_MAX here,
but I guess better safe than sorry?

Yeah. The idea of these patches is to harden the driver against all kind of nonsense the firmware might give it. With patch 1 that limits the width to 2^16, I don't think it's possible to exceed a pitch of INT_MAX, but let's check anyway.

Best regards
Thomas


Reviewed-by: Thierry Reding <[email protected]>

--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)


Reply via email to