提交 feb54650 编写于 作者: X Xiaohui Zhang 提交者: Alex Deucher

drm/radeon: integer overflow in radeon_mode_dumb_create()

Similar to the handling of amdgpu_mode_dumb_create in commit 54ef0b54
("drm/amdgpu: integer overflow in amdgpu_mode_dumb_create()"),
we thought a patch might be needed here as well.

args->size is a u64.  arg->pitch and args->height are u32.  The
multiplication will overflow instead of using the high 32 bits as
intended.
Signed-off-by: NXiaohui Zhang <xiaohuizhang@ruc.edu.cn>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 c4d7738c
......@@ -833,7 +833,7 @@ int radeon_mode_dumb_create(struct drm_file *file_priv,
args->pitch = radeon_align_pitch(rdev, args->width,
DIV_ROUND_UP(args->bpp, 8), 0);
args->size = args->pitch * args->height;
args->size = (u64)args->pitch * args->height;
args->size = ALIGN(args->size, PAGE_SIZE);
r = radeon_gem_object_create(rdev, args->size, 0,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册