drm/amdgpu: Fix integer overflow in amdgpu_gem_add_input_fence()
authorDan Carpenter <dan.carpenter@linaro.org>
Fri, 23 May 2025 16:09:52 +0000 (19:09 +0300)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 3 Jun 2025 19:31:13 +0000 (15:31 -0400)
commit335f1e797c32cbe6f313805125526b35d29280b0
treefa1a98a819294da6d203b2e6c28d4782e9608adc
parent98a46a408998102af5c45adce0871acd7967bb59
drm/amdgpu: Fix integer overflow in amdgpu_gem_add_input_fence()

The "num_syncobj_handles" is a u32 value that comes from the user via the
ioctl.  On 32bit systems the "sizeof(uint32_t) * num_syncobj_handles"
multiplication can have an integer overflow.  Use size_mul() to fix that.

Fixes: 38c67ec9aa4b ("drm/amdgpu: Add input fence to sync bo map/unmap")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c