OSDN Git Service

drm/amdgpu: fix amdgpu_cs_p1_user_fence
authorChristian König <christian.koenig@amd.com>
Fri, 25 Aug 2023 13:28:00 +0000 (15:28 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 31 Aug 2023 22:14:49 +0000 (18:14 -0400)
commit35588314e963938dfdcdb792c9170108399377d6
tree218f6be9a063734bde199072ba3ba41e2feb6229
parent46528db35561e45ff0a5e9c80d6e6e69a5877150
drm/amdgpu: fix amdgpu_cs_p1_user_fence

The offset is just 32bits here so this can potentially overflow if
somebody specifies a large value. Instead reduce the size to calculate
the last possible offset.

The error handling path incorrectly drops the reference to the user
fence BO resulting in potential reference count underflow.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c