[PATCH] drm: cast calculation to __u64 to fix potential integer overflow

2024-12-03 Thread Gax-c
From: Zichen Xie Like commit b0b0d811eac6 ("drm/mediatek: Fix coverity issue with unintentional integer overflow"), directly multiply pitch and height may lead to integer overflow. Add a cast to avoid it. Fixes: 6d1782919dc9 ("drm/cma: Introduce drm_gem_cma_dumb_create_internal()") Fixes: dc5698

[PATCH] drm/xen-front: cast calculation to __u64 in xen_drm_drv_dumb_create()

2024-11-25 Thread Gax-c
From: Zichen Xie Like commit b0b0d811eac6 ("drm/mediatek: Fix coverity issue with unintentional integer overflow"), directly multiply args->pitch and args->height may lead to integer overflow. Add a cast to avoid it. Signed-off-by: Zichen Xie --- drivers/gpu/drm/xen/xen_drm_front.c | 2 +- 1 f

[PATCH] drm: cast calculation to __u64 in qxl_mode_dumb_create()

2024-11-25 Thread Gax-c
From: Zichen Xie Like commit b0b0d811eac6 ("drm/mediatek: Fix coverity issue with unintentional integer overflow"), directly multiply pitch and args->height may lead to integer overflow. Add a cast to avoid it. Signed-off-by: Zichen Xie --- drivers/gpu/drm/qxl/qxl_dumb.c | 2 +- 1 file changed

[PATCH] drm: Use array_size() in call to copy_from_user() in drm_mode_dirtyfb_ioctl()

2024-11-14 Thread Gax-c
From: Zichen Xie Like commit ac19c4c3d02e ("bcachefs: Use array_size() in call to copy_from_user()"), it's a safer way to use helper array_size() in copy_from_user() to avoid potential overflow issues. Fixes: 7520a277d97b ("drm: Extract drm_framebuffer.[hc]") Signed-off-by: Zichen Xie --- driv

[PATCH] drm/vc4: cast calculation to __u64 in vc4_dumb_fixup_args()

2024-11-01 Thread Gax-c
From: Zichen Xie Like commit b0b0d811eac6 ("drm/mediatek: Fix coverity issue with unintentional integer overflow"), directly multiply args->pitch and args->height may lead to integer overflow. Add a cast to avoid it. Fixes: 3d7637423be8 ("drm/vc4: bo: Split out Dumb buffers fixup") Signed-off-by

[PATCH v2] drm/msm/dpu: cast crtc_clk calculation to u64 in _dpu_core_perf_calc_clk()

2024-10-29 Thread Gax-c
From: Zichen Xie There may be a potential integer overflow issue in _dpu_core_perf_calc_clk(). crtc_clk is defined as u64, while mode->vtotal, mode->hdisplay, and drm_mode_vrefresh(mode) are defined as a smaller data type. The result of the calculation will be limited to "int" in this case withou

[PATCH] drm/msm/dpu: Cast an operand to u64 to prevent potential overflow in _dpu_core_perf_calc_clk()

2024-10-29 Thread Gax-c
From: Zichen Xie There may be a potential integer overflow issue in _dpu_core_perf_calc_clk(). crtc_clk is defined as u64, while mode->vtotal, mode->hdisplay, and drm_mode_vrefresh(mode) are defined as a smaller data type. The result of the calculation will be limited to "int" in this case withou

[PATCH] drm/exynos: fix potential integer overflow in exynos_drm_gem_dumb_create()

2024-10-17 Thread Gax-c
From: Zichen Xie This was found by a static analyzer. There may be potential integer overflow issue in exynos_drm_gem_dumb_create(). args->size is defined as "__u64" while args->pitch and args->height are both defined as "__u32". The result of "args->pitch * args->height" will be limited to "__u3

[PATCH] drm/rockchip: fix potential integer overflow in rockchip_gem_dumb_create()

2024-10-16 Thread Gax-c
From: Zichen Xie There may be potential integer overflow issue in rockchip_gem_dumb_create(). args->size is defined as "__u64" while args->pitch and args->height are both defined as "__u32". The result of "args->pitch * args->height" will be limited to "__u32" without correct casting. Cast it to