drm/exynos: fix potential integer overflow in exynos_drm_gem_dumb_create()
Subsystems (3)
PATCH 1/1 drm/exynos: fix potential integer overflow in exynos_drm_gem_dumb_create()
From: Zichen Xie <[email protected]>
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 "__u32" without correct casting.
Even if the overflow is quite difficult to happen, we still recommand adding an extra cast.
Fixes 7da5907c84f8 ("drm/exynos: fixed page align bug.")
Signed-off-by Zichen Xie <[email protected]>
--- drivers/gpu/drm/exynos/exynos_drm_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/exynos/exynos_drm_gem.c +1 -1
@@ -337,7 +337,7 @@ int exynos_drm_gem_dumb_create(struct drm_file *file_priv,*/ args->pitch = args->width * ((args->bpp +7 ) /8 ); - args->size = args->pitch * args->height; + args->size = (__u64 )args->pitch * args->height;if (is_drm_iommu_supported (dev)) flags =EXYNOS_BO_NONCONTIG |EXYNOS_BO_WC ;
Signature · 1 line
2.34.1