linux/drivers/gpu/drm/tiny
Nikita Zhandarovich c177517ea6 drm/repaper: fix integer overflows in repeat functions
commit 4d098000ac upstream.

There are conditions, albeit somewhat unlikely, under which right hand
expressions, calculating the end of time period in functions like
repaper_frame_fixed_repeat(), may overflow.

For instance, if 'factor10x' in repaper_get_temperature() is high
enough (170), as is 'epd->stage_time' in repaper_probe(), then the
resulting value of 'end' will not fit in unsigned int expression.

Mitigate this by casting 'epd->factored_stage_time' to wider type before
any multiplication is done.

Found by Linux Verification Center (linuxtesting.org) with static
analysis tool SVACE.

Fixes: 3589211e9b ("drm/tinydrm: Add RePaper e-ink driver")
Cc: stable@vger.kernel.org
Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru>
Signed-off-by: Alex Lanzano <lanzano.alex@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250116134801.22067-1-n.zhandarovich@fintech.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-05-02 07:44:14 +02:00
..
arcpgu.c drm/arc: Move to drm/tiny 2021-02-25 13:19:04 +01:00
bochs.c drm/bochs: fix blanking 2022-10-26 12:34:54 +02:00
cirrus.c drm/cirrus: NULL-check pipe->plane.state->fb in cirrus_pipe_update() 2023-03-30 12:47:52 +02:00
gm12u320.c drm: gm12u320: Fix the timeout usage for usb_bulk_msg() 2023-09-23 11:10:01 +02:00
hx8357d.c drm/tiny: drm_gem_simple_display_pipe_prepare_fb is the default 2021-06-24 15:40:11 +02:00
ili9225.c drm/tiny: drm_gem_simple_display_pipe_prepare_fb is the default 2021-06-24 15:40:11 +02:00
ili9341.c drm/tiny: drm_gem_simple_display_pipe_prepare_fb is the default 2021-06-24 15:40:11 +02:00
ili9486.c drm/tiny: ili9486: Do not assume 8-bit only SPI controllers 2023-03-10 09:39:52 +01:00
Kconfig drivers/firmware: consolidate EFI framebuffer setup for all arches 2021-07-21 12:04:56 +02:00
Makefile drm/bochs: Move to tiny/ 2021-07-05 08:54:44 +02:00
mi0283qt.c drm/tiny: drm_gem_simple_display_pipe_prepare_fb is the default 2021-06-24 15:40:11 +02:00
repaper.c drm/repaper: fix integer overflows in repeat functions 2025-05-02 07:44:14 +02:00
simpledrm.c drm/simpledrm: Fix return type of simpledrm_simple_display_pipe_mode_valid() 2022-08-03 12:03:43 +02:00
st7586.c drm/st7586: Use framebuffer dma-buf helpers 2021-07-23 20:18:14 +02:00
st7735r.c drm/st7735r: Fix module autoloading for Okaya RH128128T 2022-08-17 14:23:16 +02:00