drm/amdkfd: Fix the memory overrun
authorjsg <jsg@openbsd.org>
Fri, 31 Mar 2023 02:16:10 +0000 (02:16 +0000)
committerjsg <jsg@openbsd.org>
Fri, 31 Mar 2023 02:16:10 +0000 (02:16 +0000)
From Ma Jun
8c31b663edc1cc5eb5c82282ab6ca99c69d1d942 in linux-6.1.y/6.1.22
4cc16d64b6cdb179a26fb389cae9dce788e88f5d in mainline linux

sys/dev/pci/drm/amd/amdkfd/kfd_crat.c

index f522e1c..e45c6bc 100644 (file)
@@ -1111,7 +1111,7 @@ static int kfd_parse_subtype_cache(struct crat_subtype_cache *cache,
                        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;