]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Sep 2023 09:11:12 +0000 (11:11 +0200)
commit4c6bb91581796d34466d85bc06c9393d27f83101
tree0d14ff1a8b23fdbed8a28aed664df347e60b53f5
parent45ea58f9dbf8faecc733e4f1db06a55fc0e7e6a7
drm/amdgpu: fix amdgpu_cs_p1_user_fence

commit 35588314e963938dfdcdb792c9170108399377d6 upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c