linux/drivers/gpu/drm/tiny
Nikita Zhandarovich 3ba56fc34f 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-04-25 10:43:56 +02:00
..
arcpgu.c drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr} 2022-08-03 18:32:27 +02:00
bochs.c drm/bochs: fix blanking 2022-09-07 12:13:22 +02:00
cirrus.c drm/cirrus: NULL-check pipe->plane.state->fb in cirrus_pipe_update() 2023-03-30 12:49:16 +02:00
gm12u320.c drm: gm12u320: Fix the timeout usage for usb_bulk_msg() 2023-09-23 11:11:08 +02:00
hx8357d.c drm/probe-helper: Add drm_crtc_helper_mode_valid_fixed() 2022-09-12 09:14:26 +02:00
ili9163.c drm/probe-helper: Add drm_crtc_helper_mode_valid_fixed() 2022-09-12 09:14:26 +02:00
ili9225.c drm/gem: rename GEM CMA helpers to GEM DMA helpers 2022-08-03 18:31:49 +02:00
ili9341.c drm/probe-helper: Add drm_crtc_helper_mode_valid_fixed() 2022-09-12 09:14:26 +02:00
ili9486.c drm/tiny: ili9486: Do not assume 8-bit only SPI controllers 2023-03-10 09:33:55 +01:00
Kconfig drm/gem: rename GEM CMA helpers to GEM DMA helpers 2022-08-03 18:31:49 +02:00
Makefile drm/tiny: Add MIPI DBI compatible SPI driver 2022-02-28 10:29:33 +01:00
mi0283qt.c drm/probe-helper: Add drm_crtc_helper_mode_valid_fixed() 2022-09-12 09:14:26 +02:00
panel-mipi-dbi.c drm/probe-helper: Add drm_crtc_helper_mode_valid_fixed() 2022-09-12 09:14:26 +02:00
repaper.c drm/repaper: fix integer overflows in repeat functions 2025-04-25 10:43:56 +02:00
simpledrm.c drm/simpledrm: Synchronize access to GEM BOs 2022-09-27 10:27:00 +02:00
st7586.c drm/format-helper: Rework XRGB8888-to-GRAY8 conversion 2022-08-10 09:18:49 +02:00
st7735r.c drm/probe-helper: Add drm_crtc_helper_mode_valid_fixed() 2022-09-12 09:14:26 +02:00