From 33672b6d45df9fb260bf77f4149da956b84e79e1 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 28 Mar 2023 16:06:07 +0200 Subject: [PATCH] 6.1-stable patches added patches: drm-amdkfd-fix-the-memory-overrun.patch --- .../drm-amdkfd-fix-the-memory-overrun.patch | 33 +++++++++++++++++++ queue-6.1/series | 1 + 2 files changed, 34 insertions(+) create mode 100644 queue-6.1/drm-amdkfd-fix-the-memory-overrun.patch diff --git a/queue-6.1/drm-amdkfd-fix-the-memory-overrun.patch b/queue-6.1/drm-amdkfd-fix-the-memory-overrun.patch new file mode 100644 index 00000000000..5ba4135982e --- /dev/null +++ b/queue-6.1/drm-amdkfd-fix-the-memory-overrun.patch @@ -0,0 +1,33 @@ +From 4cc16d64b6cdb179a26fb389cae9dce788e88f5d Mon Sep 17 00:00:00 2001 +From: Ma Jun +Date: Sun, 6 Nov 2022 20:34:27 +0800 +Subject: drm/amdkfd: Fix the memory overrun + +From: Ma Jun + +commit 4cc16d64b6cdb179a26fb389cae9dce788e88f5d upstream. + +Fix the memory overrun issue caused by wrong array size. + +Signed-off-by: Ma Jun +Reviewed-by: Felix Kuehling +Reported-by: coverity-bot +Addresses-Coverity-ID: 1527133 ("Memory - corruptions") +Fixes: c0cc999f3c32e6 ("drm/amdkfd: Fix the warning of array-index-out-of-bounds") +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c ++++ b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c +@@ -1111,7 +1111,7 @@ static int kfd_parse_subtype_cache(struc + props->cache_latency = cache->cache_latency; + + memcpy(props->sibling_map, cache->sibling_map, +- sizeof(props->sibling_map)); ++ CRAT_SIBLINGMAP_SIZE); + + /* set the sibling_map_size as 32 for CRAT from ACPI */ + props->sibling_map_size = CRAT_SIBLINGMAP_SIZE; diff --git a/queue-6.1/series b/queue-6.1/series index 744be745ff4..3bb861c2bb2 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -221,3 +221,4 @@ sched-fair-sanitize-vruntime-of-entity-being-migrated.patch drm-amdkfd-introduce-dummy-cache-info-for-property-asic.patch drm-amdkfd-fix-the-warning-of-array-index-out-of-bounds.patch drm-amdkfd-add-gc-11.0.4-kfd-support.patch +drm-amdkfd-fix-the-memory-overrun.patch -- 2.47.3