All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] drm/amdgpu: Reject UVD message with dimensions above 4096
@ 2026-07-30 17:02 David Rosca
  2026-07-30 17:02 ` [PATCH 2/4] drm/amdgpu: Fix UVD dpb min size calculation for H264 David Rosca
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: David Rosca @ 2026-07-30 17:02 UTC (permalink / raw)
  To: amd-gfx; +Cc: David Rosca

Fixes potential overflow in DPB size calculations.

Signed-off-by: David Rosca <david.rosca@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
index e8b0c62f72be..63561d1d7963 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
@@ -655,8 +655,8 @@ static int amdgpu_uvd_cs_msg_decode(struct amdgpu_device *adev, uint32_t *msg,
 	unsigned int image_size, tmp, min_dpb_size, num_dpb_buffer;
 	unsigned int min_ctx_size = ~0;
 
-	/* Reject invalid dimensions to prevent division by zero */
-	if (width < 16 || height < 16) {
+	/* Reject invalid dimensions */
+	if (width < 16 || height < 16 || width > 4096 || height > 4096) {
 		dev_WARN_ONCE(adev->dev, 1,
 			      "Invalid UVD decoding dimensions (%dx%d)!\n",
 			      width, height);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-08-05 14:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-30 17:02 [PATCH 1/4] drm/amdgpu: Reject UVD message with dimensions above 4096 David Rosca
2026-07-30 17:02 ` [PATCH 2/4] drm/amdgpu: Fix UVD dpb min size calculation for H264 David Rosca
2026-07-30 17:02 ` [PATCH 3/4] drm/amdgpu: Fix UVD decode image min size calculation David Rosca
2026-07-30 17:02 ` [PATCH 4/4] drm/amdgpu: Fix UVD min buffer sizes David Rosca
2026-08-05 14:57   ` Liu, Leo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.