]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: fix integer overflow test in amdgpu_bo_list_create()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 10 Aug 2018 10:50:32 +0000 (18:50 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 27 Aug 2018 16:10:42 +0000 (11:10 -0500)
commit280e95cebaf099c7c5f50c7acc3176a0f0b55342
treea890dbb842f5a75983309beac1dfc651309f6c03
parentbd895d67258a343c1cc178a4aaeecf70624e4a00
drm/amdgpu: fix integer overflow test in amdgpu_bo_list_create()

We accidentally left out the size of the amdgpu_bo_list struct.  It
could lead to memory corruption on 32 bit systems.  You'd have to
pick the absolute maximum and set "num_entries == 59652323" then size
would wrap to 16 bytes.

Fixes: 017fba0617c0 ("drm/amdgpu: allocate the bo_list array after the list")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Bas Nieuwenhuizen <basni@chromium.org>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c