summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
diff options
context:
space:
mode:
authorJesse.Zhang <Jesse.Zhang@amd.com>2026-03-12 18:06:17 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-03-25 11:13:21 +0100
commitf462624a6e4b5f1ec2664c2c53e408b2f4fb53e9 (patch)
treea7add3998874d3363a1b5bbfceba71b205c4773a /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
parent08275ca70b1cf586a700605847f9f87a4e773a3d (diff)
drm/amdgpu: Limit BO list entry count to prevent resource exhaustion
commit 6270b1a5dab94665d7adce3dc78bc9066ed28bdd upstream. Userspace can pass an arbitrary number of BO list entries via the bo_number field. Although the previous multiplication overflow check prevents out-of-bounds allocation, a large number of entries could still cause excessive memory allocation (up to potentially gigabytes) and unnecessarily long list processing times. Introduce a hard limit of 128k entries per BO list, which is more than sufficient for any realistic use case (e.g., a single list containing all buffers in a large scene). This prevents memory exhaustion attacks and ensures predictable performance. Return -EINVAL if the requested entry count exceeds the limit Reviewed-by: Christian König <christian.koenig@amd.com> Suggested-by: Christian König <christian.koenig@amd.com> Signed-off-by: Jesse Zhang <jesse.zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 688b87d39e0aa8135105b40dc167d74b5ada5332) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h')
0 files changed, 0 insertions, 0 deletions