From: Greg Kroah-Hartman Date: Wed, 12 Jun 2024 14:52:53 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v4.19.316~103 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9e27cd804638c6a1e9f3ee29c82447037f188875;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: drm-amdgpu-add-error-handle-to-avoid-out-of-bounds.patch --- diff --git a/queue-5.10/drm-amdgpu-add-error-handle-to-avoid-out-of-bounds.patch b/queue-5.10/drm-amdgpu-add-error-handle-to-avoid-out-of-bounds.patch new file mode 100644 index 00000000000..08fa6fdc63a --- /dev/null +++ b/queue-5.10/drm-amdgpu-add-error-handle-to-avoid-out-of-bounds.patch @@ -0,0 +1,36 @@ +From 8b2faf1a4f3b6c748c0da36cda865a226534d520 Mon Sep 17 00:00:00 2001 +From: Bob Zhou +Date: Tue, 23 Apr 2024 16:58:11 +0800 +Subject: drm/amdgpu: add error handle to avoid out-of-bounds +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Bob Zhou + +commit 8b2faf1a4f3b6c748c0da36cda865a226534d520 upstream. + +if the sdma_v4_0_irq_id_to_seq return -EINVAL, the process should +be stop to avoid out-of-bounds read, so directly return -EINVAL. + +Signed-off-by: Bob Zhou +Acked-by: Christian König +Reviewed-by: Le Ma +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c ++++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +@@ -2073,6 +2073,9 @@ static int sdma_v4_0_process_trap_irq(st + + DRM_DEBUG("IH: SDMA trap\n"); + instance = sdma_v4_0_irq_id_to_seq(entry->client_id); ++ if (instance < 0) ++ return instance; ++ + switch (entry->ring_id) { + case 0: + amdgpu_fence_process(&adev->sdma.instance[instance].ring); diff --git a/queue-5.10/series b/queue-5.10/series index c48d4f9a4f6..41f956c9ee7 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -274,3 +274,4 @@ netfilter-nf_tables-restrict-tunnel-object-to-nfproto_netdev.patch netfilter-nf_tables-fix-potential-data-race-in-__nft_obj_type_get.patch f2fs-fix-to-do-sanity-check-on-i_xattr_nid-in-sanity_check_inode.patch media-lgdt3306a-add-a-check-against-null-pointer-def.patch +drm-amdgpu-add-error-handle-to-avoid-out-of-bounds.patch