linux/drivers/gpu/drm/tiny
Nikita Zhandarovich b33386fabb 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:47:57 +02:00
..
arcpgu.c drm/arcpgu: Convert to platform remove callback returning void 2023-11-21 09:17:49 +01:00
bochs.c drm/tiny: add missing MODULE_DESCRIPTION() macros 2024-06-10 12:44:32 +02:00
cirrus.c drm/tiny: add missing MODULE_DESCRIPTION() macros 2024-06-10 12:44:32 +02:00
gm12u320.c drm/tiny/gm12u320: convert to struct drm_edid 2024-08-29 14:30:15 +03:00
hx8357d.c drm/tiny/hx8357d: Use fbdev-dma 2024-05-02 11:33:27 +02:00
ili9163.c drm/tiny/ili9163: Use fbdev-dma 2024-05-02 11:33:28 +02:00
ili9225.c drm/tiny/ili9225: Use fbdev-dma 2024-05-02 11:33:28 +02:00
ili9341.c drm/tiny/ili9341: Use fbdev-dma 2024-05-02 11:33:29 +02:00
ili9486.c drm/tiny/ili9486: Use fbdev-dma 2024-05-02 11:33:29 +02:00
Kconfig drm/ofdrm: Depend on CONFIG_MMU 2022-11-03 10:17:53 +01:00
Makefile drm/ofdrm: Add ofdrm for Open Firmware framebuffers 2022-10-14 09:49:47 +02:00
mi0283qt.c drm/tiny/mi0283qt: Use fbdev-dma 2024-05-02 11:33:30 +02:00
ofdrm.c drm/tiny/ofdrm: Use fbdev-shmem 2024-05-02 11:33:20 +02:00
panel-mipi-dbi.c drm/tiny: panel-mipi-dbi: Support the pixel format property 2024-06-07 16:09:06 +02:00
repaper.c drm/repaper: fix integer overflows in repeat functions 2025-04-25 10:47:57 +02:00
simpledrm.c drm/tiny/simpledrm: Use fbdev-shmem 2024-05-02 11:33:20 +02:00
st7586.c drm/tiny/st7586: Use fbdev-dma 2024-05-02 11:33:31 +02:00
st7735r.c drm/tiny/st7735r: Use fbdev-dma 2024-05-02 11:33:32 +02:00