summaryrefslogtreecommitdiff |
diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2019-01-10 15:58:26 +0100 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2019-01-11 13:41:55 +0100 |
commit | 34bb1f2492b7f4dd918b4268a4afb6d801850b2e (patch) | |
tree | 2032cd048ae502c43f6e393114b47c08e9a45f9a | |
parent | b47a5f2bef24bdc47c22b087ca4db30f4000afd2 (diff) |
drm/amdgpu: fix integer overflow test in amdgpu_bo_list_create() (bsc#1113956)
suse-commit: a9353983e3ca6840ed988fc732884832d6406454
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c index d472a2c8399f..b80243d3972e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c @@ -67,7 +67,8 @@ int amdgpu_bo_list_create(struct amdgpu_device *adev, struct drm_file *filp, unsigned i; int r; - if (num_entries > SIZE_MAX / sizeof(struct amdgpu_bo_list_entry)) + if (num_entries > (SIZE_MAX - sizeof(struct amdgpu_bo_list)) + / sizeof(struct amdgpu_bo_list_entry)) return -EINVAL; size = sizeof(struct amdgpu_bo_list); |