diff options
Diffstat (limited to 'meta-amdfalconx86/recipes-kernel/linux/linux-yocto/0562-drm-amdgpu-integer-overflow-in-amdgpu_mode_dumb_crea.patch')
-rw-r--r-- | meta-amdfalconx86/recipes-kernel/linux/linux-yocto/0562-drm-amdgpu-integer-overflow-in-amdgpu_mode_dumb_crea.patch | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/meta-amdfalconx86/recipes-kernel/linux/linux-yocto/0562-drm-amdgpu-integer-overflow-in-amdgpu_mode_dumb_crea.patch b/meta-amdfalconx86/recipes-kernel/linux/linux-yocto/0562-drm-amdgpu-integer-overflow-in-amdgpu_mode_dumb_crea.patch new file mode 100644 index 00000000..e60361b1 --- /dev/null +++ b/meta-amdfalconx86/recipes-kernel/linux/linux-yocto/0562-drm-amdgpu-integer-overflow-in-amdgpu_mode_dumb_crea.patch @@ -0,0 +1,36 @@ +From 54ef0b5461c071050c61e501af5544842d61f40a Mon Sep 17 00:00:00 2001 +From: Dan Carpenter <dan.carpenter@oracle.com> +Date: Wed, 23 Sep 2015 14:00:59 +0300 +Subject: [PATCH 0562/1050] drm/amdgpu: integer overflow in + amdgpu_mode_dumb_create() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +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> +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +index b82fab2..7297ca3 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, +-- +1.9.1 + |