linux/drivers/gpu/drm/tiny
Nikita Zhandarovich 4d098000ac drm/repaper: fix integer overflows in repeat functions
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
History 2025-02-24 19:43:23 -05:00
..
arcpgu.c Merge remote-tracking branch 'drm/drm-next' into drm-misc-next 2024-12-09 16:35:21 +01:00
bochs.c Short summary of fixes pull: 2025-01-24 11:26:41 +01:00
cirrus-qemu.c drm: remove driver date from struct drm_driver and all drivers 2024-12-05 12:35:42 +02:00
gm12u320.c drm: remove driver date from struct drm_driver and all drivers 2024-12-05 12:35:42 +02:00
hx8357d.c drm: remove driver date from struct drm_driver and all drivers 2024-12-05 12:35:42 +02:00
ili9163.c drm: remove driver date from struct drm_driver and all drivers 2024-12-05 12:35:42 +02:00
ili9225.c drm: remove driver date from struct drm_driver and all drivers 2024-12-05 12:35:42 +02:00
ili9341.c drm: remove driver date from struct drm_driver and all drivers 2024-12-05 12:35:42 +02:00
ili9486.c drm: remove driver date from struct drm_driver and all drivers 2024-12-05 12:35:42 +02:00
Kconfig drm/tiny: Add driver for Sharp Memory LCD 2024-10-19 02:21:32 +03:00
Makefile drm/cirrus: Rename to cirrus-qemu 2024-11-26 14:21:51 +01:00
mi0283qt.c drm: remove driver date from struct drm_driver and all drivers 2024-12-05 12:35:42 +02:00
ofdrm.c Merge remote-tracking branch 'drm/drm-next' into drm-misc-next 2024-12-09 16:35:21 +01:00
panel-mipi-dbi.c drm/tiny: panel-mipi-dbi: Include <linux/of.h> 2024-12-13 15:21:02 +01:00
repaper.c drm/repaper: fix integer overflows in repeat functions 2025-02-24 19:43:23 -05:00
sharp-memory.c drm: remove driver date from struct drm_driver and all drivers 2024-12-05 12:35:42 +02:00
simpledrm.c Merge remote-tracking branch 'drm/drm-next' into drm-misc-next 2024-12-09 16:35:21 +01:00
st7586.c drm: remove driver date from struct drm_driver and all drivers 2024-12-05 12:35:42 +02:00
st7735r.c drm: remove driver date from struct drm_driver and all drivers 2024-12-05 12:35:42 +02:00