diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-09-23 13:00:59 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-09-23 23:23:44 +0200 |
commit | 54ef0b5461c071050c61e501af5544842d61f40a (patch) | |
tree | 99629cb42eb400a13be2323608f507244724ad81 /drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | |
parent | drm/amdgpu: info leak in amdgpu_gem_metadata_ioctl() (diff) | |
download | linux-54ef0b5461c071050c61e501af5544842d61f40a.tar.xz linux-54ef0b5461c071050c61e501af5544842d61f40a.zip |
drm/amdgpu: integer overflow in amdgpu_mode_dumb_create()
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.
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index b82fab2cc888..7297ca3a0ba7 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c @@ -659,7 +659,7 @@ int amdgpu_mode_dumb_create(struct drm_file *file_priv, int r; args->pitch = amdgpu_align_pitch(adev, args->width, args->bpp, 0) * ((args->bpp + 1) / 8); - args->size = args->pitch * args->height; + args->size = (u64)args->pitch * args->height; args->size = ALIGN(args->size, PAGE_SIZE); r = amdgpu_gem_object_create(adev, args->size, 0, |