From: Greg Kroah-Hartman Date: Wed, 29 Jul 2026 16:26:00 +0000 (+0200) Subject: 5.15-stable patches X-Git-Tag: v5.10.262~17 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=2deff302d3798a6cdc7bd203e9be2cc30440f633;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: drm-amdgpu-fix-division-by-zero-with-invalid-uvd-dimensions.patch drm-amdgpu-gfx10-replace-bug_on-with-warn_on.patch drm-amdgpu-gfx8-drop-unecessary-bug_on.patch drm-amdgpu-gfx9-replace-bug_on-with-warn_on.patch drm-amdgpu-invoke-pm_genpd_remove-before-freeing-genpd.patch --- diff --git a/queue-5.15/drm-amdgpu-fix-division-by-zero-with-invalid-uvd-dimensions.patch b/queue-5.15/drm-amdgpu-fix-division-by-zero-with-invalid-uvd-dimensions.patch new file mode 100644 index 0000000000..d8c495fe8a --- /dev/null +++ b/queue-5.15/drm-amdgpu-fix-division-by-zero-with-invalid-uvd-dimensions.patch @@ -0,0 +1,48 @@ +From 0c01c811be47e6b146552dd59bfedbea8f09b8f4 Mon Sep 17 00:00:00 2001 +From: Boyuan Zhang +Date: Tue, 12 May 2026 10:29:36 -0400 +Subject: drm/amdgpu: fix division by zero with invalid uvd dimensions + +From: Boyuan Zhang + +commit 0c01c811be47e6b146552dd59bfedbea8f09b8f4 upstream. + +When width or height is less than 16, width_in_mb or height_in_mb +becomes 0, leading to fs_in_mb being 0. This causes a division by +zero when calculating num_dpb_buffer in H264 and H264 Perf decode +paths. + +Add validation to reject frames with width < 16 or height < 16 +before performing any calculations that depend on these values. + +V2: Format change - move up all vaiable definitions. +V3: Use warn_once to avoid spam. + +Signed-off-by: Boyuan Zhang +Reviewed-by: Leo Liu +Reviewed-by: Alex Deucher +Signed-off-by: Alex Deucher +(cherry picked from commit 3e41d26c70b0a459d041cc19482a226c4b7423cb) +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +@@ -578,6 +578,14 @@ static int amdgpu_uvd_cs_msg_decode(stru + unsigned image_size, tmp, min_dpb_size, num_dpb_buffer; + unsigned min_ctx_size = ~0; + ++ /* Reject invalid dimensions to prevent division by zero */ ++ if (width < 16 || height < 16) { ++ dev_WARN_ONCE(adev->dev, 1, ++ "Invalid UVD decoding dimensions (%dx%d)!\n", ++ width, height); ++ return -EINVAL; ++ } ++ + image_size = width * height; + image_size += image_size / 2; + image_size = ALIGN(image_size, 1024); diff --git a/queue-5.15/drm-amdgpu-gfx10-replace-bug_on-with-warn_on.patch b/queue-5.15/drm-amdgpu-gfx10-replace-bug_on-with-warn_on.patch new file mode 100644 index 0000000000..f56d377cab --- /dev/null +++ b/queue-5.15/drm-amdgpu-gfx10-replace-bug_on-with-warn_on.patch @@ -0,0 +1,71 @@ +From d06c4173a7c38c7a39e98859f839ce714c7af2c9 Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Mon, 15 Jun 2026 18:19:52 -0400 +Subject: drm/amdgpu/gfx10: replace BUG_ON() with WARN_ON() + +From: Alex Deucher + +commit d06c4173a7c38c7a39e98859f839ce714c7af2c9 upstream. + +There's no need to crash the kernel for these cases. + +Reviewed-by: Vitaly Prosyak +Signed-off-by: Alex Deucher +(cherry picked from commit ac6f00beb658239bced4aaed9efbb04a35348d48) +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 13 +++++-------- + 1 file changed, 5 insertions(+), 8 deletions(-) + +--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c ++++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +@@ -3854,7 +3854,7 @@ static void gfx_v10_0_wait_reg_mem(struc + WAIT_REG_MEM_ENGINE(eng_sel))); + + if (mem_space) +- BUG_ON(addr0 & 0x3); /* Dword align */ ++ WARN_ON(addr0 & 0x3); /* Dword align */ + amdgpu_ring_write(ring, addr0); + amdgpu_ring_write(ring, addr1); + amdgpu_ring_write(ring, ref); +@@ -8629,7 +8629,7 @@ static void gfx_v10_0_ring_emit_ib_gfx(s + } + + amdgpu_ring_write(ring, header); +- BUG_ON(ib->gpu_addr & 0x3); /* Dword align */ ++ WARN_ON(ib->gpu_addr & 0x3); /* Dword align */ + amdgpu_ring_write(ring, + #ifdef __BIG_ENDIAN + (2 << 0) | +@@ -8664,7 +8664,7 @@ static void gfx_v10_0_ring_emit_ib_compu + } + + amdgpu_ring_write(ring, PACKET3(PACKET3_INDIRECT_BUFFER, 2)); +- BUG_ON(ib->gpu_addr & 0x3); /* Dword align */ ++ WARN_ON(ib->gpu_addr & 0x3); /* Dword align */ + amdgpu_ring_write(ring, + #ifdef __BIG_ENDIAN + (2 << 0) | +@@ -8697,9 +8697,9 @@ static void gfx_v10_0_ring_emit_fence(st + * aligned if only send 32bit data low (discard data high) + */ + if (write64bit) +- BUG_ON(addr & 0x7); ++ WARN_ON(addr & 0x7); + else +- BUG_ON(addr & 0x3); ++ WARN_ON(addr & 0x3); + amdgpu_ring_write(ring, lower_32_bits(addr)); + amdgpu_ring_write(ring, upper_32_bits(addr)); + amdgpu_ring_write(ring, lower_32_bits(seq)); +@@ -8735,9 +8735,6 @@ static void gfx_v10_0_ring_emit_fence_ki + { + struct amdgpu_device *adev = ring->adev; + +- /* we only allocate 32bit for each seq wb address */ +- BUG_ON(flags & AMDGPU_FENCE_FLAG_64BIT); +- + /* write fence seq to the "addr" */ + amdgpu_ring_write(ring, PACKET3(PACKET3_WRITE_DATA, 3)); + amdgpu_ring_write(ring, (WRITE_DATA_ENGINE_SEL(0) | diff --git a/queue-5.15/drm-amdgpu-gfx8-drop-unecessary-bug_on.patch b/queue-5.15/drm-amdgpu-gfx8-drop-unecessary-bug_on.patch new file mode 100644 index 0000000000..3e714f606a --- /dev/null +++ b/queue-5.15/drm-amdgpu-gfx8-drop-unecessary-bug_on.patch @@ -0,0 +1,32 @@ +From 84a1a8a952ab4b8c23c5dd1f2eea4049cb4914f5 Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Mon, 15 Jun 2026 18:17:59 -0400 +Subject: drm/amdgpu/gfx8: drop unecessary BUG_ON() + +From: Alex Deucher + +commit 84a1a8a952ab4b8c23c5dd1f2eea4049cb4914f5 upstream. + +There's no need to crash the kernel for this case. + +Reviewed-by: Vitaly Prosyak +Signed-off-by: Alex Deucher +(cherry picked from commit 4d7c25208ca612b754f3bf39e9f16e725b828891) +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 3 --- + 1 file changed, 3 deletions(-) + +--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c ++++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +@@ -6301,9 +6301,6 @@ static void gfx_v8_0_ring_emit_fence_com + static void gfx_v8_0_ring_emit_fence_kiq(struct amdgpu_ring *ring, u64 addr, + u64 seq, unsigned int flags) + { +- /* we only allocate 32bit for each seq wb address */ +- BUG_ON(flags & AMDGPU_FENCE_FLAG_64BIT); +- + /* write fence seq to the "addr" */ + amdgpu_ring_write(ring, PACKET3(PACKET3_WRITE_DATA, 3)); + amdgpu_ring_write(ring, (WRITE_DATA_ENGINE_SEL(0) | diff --git a/queue-5.15/drm-amdgpu-gfx9-replace-bug_on-with-warn_on.patch b/queue-5.15/drm-amdgpu-gfx9-replace-bug_on-with-warn_on.patch new file mode 100644 index 0000000000..ece5fe3c0a --- /dev/null +++ b/queue-5.15/drm-amdgpu-gfx9-replace-bug_on-with-warn_on.patch @@ -0,0 +1,61 @@ +From 6302be10b521f5106ce01eb5a724b9e7945a5061 Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Mon, 15 Jun 2026 18:14:59 -0400 +Subject: drm/amdgpu/gfx9: replace BUG_ON() with WARN_ON() + +From: Alex Deucher + +commit 6302be10b521f5106ce01eb5a724b9e7945a5061 upstream. + +There's no need to crash the kernel for these cases. + +Reviewed-by: Vitaly Prosyak +Signed-off-by: Alex Deucher +(cherry picked from commit b71604f8685b0eba07866f4e8dc30f93e1931054) +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c ++++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +@@ -1052,7 +1052,7 @@ static void gfx_v9_0_wait_reg_mem(struct + WAIT_REG_MEM_ENGINE(eng_sel))); + + if (mem_space) +- BUG_ON(addr0 & 0x3); /* Dword align */ ++ WARN_ON(addr0 & 0x3); /* Dword align */ + amdgpu_ring_write(ring, addr0); + amdgpu_ring_write(ring, addr1); + amdgpu_ring_write(ring, ref); +@@ -5395,7 +5395,7 @@ static void gfx_v9_0_ring_emit_ib_gfx(st + } + + amdgpu_ring_write(ring, header); +- BUG_ON(ib->gpu_addr & 0x3); /* Dword align */ ++ WARN_ON(ib->gpu_addr & 0x3); /* Dword align */ + amdgpu_ring_write(ring, + #ifdef __BIG_ENDIAN + (2 << 0) | +@@ -5430,7 +5430,7 @@ static void gfx_v9_0_ring_emit_ib_comput + } + + amdgpu_ring_write(ring, PACKET3(PACKET3_INDIRECT_BUFFER, 2)); +- BUG_ON(ib->gpu_addr & 0x3); /* Dword align */ ++ WARN_ON(ib->gpu_addr & 0x3); /* Dword align */ + amdgpu_ring_write(ring, + #ifdef __BIG_ENDIAN + (2 << 0) | +@@ -5464,9 +5464,9 @@ static void gfx_v9_0_ring_emit_fence(str + * aligned if only send 32bit data low (discard data high) + */ + if (write64bit) +- BUG_ON(addr & 0x7); ++ WARN_ON(addr & 0x7); + else +- BUG_ON(addr & 0x3); ++ WARN_ON(addr & 0x3); + amdgpu_ring_write(ring, lower_32_bits(addr)); + amdgpu_ring_write(ring, upper_32_bits(addr)); + amdgpu_ring_write(ring, lower_32_bits(seq)); diff --git a/queue-5.15/drm-amdgpu-invoke-pm_genpd_remove-before-freeing-genpd.patch b/queue-5.15/drm-amdgpu-invoke-pm_genpd_remove-before-freeing-genpd.patch new file mode 100644 index 0000000000..eb8916ffe5 --- /dev/null +++ b/queue-5.15/drm-amdgpu-invoke-pm_genpd_remove-before-freeing-genpd.patch @@ -0,0 +1,34 @@ +From 28c9b3c5dc35cc790d11e26ca3fc6e068be63998 Mon Sep 17 00:00:00 2001 +From: Ce Sun +Date: Mon, 22 Jun 2026 22:58:16 +0800 +Subject: drm/amdgpu: invoke pm_genpd_remove() before freeing genpd + +From: Ce Sun + +commit 28c9b3c5dc35cc790d11e26ca3fc6e068be63998 upstream. + +Call pm_genpd_remove() to unregister from global list prior to releasing +acp_genpd memory, and clear the pointer after free. + +Signed-off-by: Ce Sun +Reviewed-by: Tao Zhou +Signed-off-by: Alex Deucher +(cherry picked from commit cd8650d7a91ee8b768e202354672553faa5cc1f2) +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +@@ -466,7 +466,9 @@ static int acp_hw_fini(void *handle) + + mfd_remove_devices(adev->acp.parent); + kfree(adev->acp.acp_res); ++ pm_genpd_remove(&adev->acp.acp_genpd->gpd); + kfree(adev->acp.acp_genpd); ++ adev->acp.acp_genpd = NULL; + kfree(adev->acp.acp_cell); + + return 0; diff --git a/queue-5.15/series b/queue-5.15/series index 6000c46b78..7b3c90c883 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -225,3 +225,8 @@ ila-reload-ipv6-header-after-pskb_may_pull-in-checksum-adjust.patch mac802154-llsec-reject-frames-shorter-than-the-authentication-tag.patch pppoe-reload-header-pointer-after-dev_hard_header.patch tipc-clear-sock-sk-on-the-failed-insert-path-in-tipc_sk_create.patch +drm-amdgpu-gfx10-replace-bug_on-with-warn_on.patch +drm-amdgpu-gfx8-drop-unecessary-bug_on.patch +drm-amdgpu-gfx9-replace-bug_on-with-warn_on.patch +drm-amdgpu-fix-division-by-zero-with-invalid-uvd-dimensions.patch +drm-amdgpu-invoke-pm_genpd_remove-before-freeing-genpd.patch