{"id":"CVE-2024-56695","published":"2024-12-28T09:46:19Z","modified":"2026-05-11T20:57:27Z","title":"drm/amdkfd: Use dynamic allocation for CU occupancy array in 'kfd_get_cu_occupancy()'","vendor":"Linux","product":"Linux","tier":"tail","description":{"text":"In the Linux kernel, the following vulnerability has been resolved:\n\ndrm/amdkfd: Use dynamic allocation for CU occupancy array in 'kfd_get_cu_occupancy()'\n\nThe `kfd_get_cu_occupancy` function previously declared a large\n`cu_occupancy` array as a local variable, which could lead to stack\noverflows due to excessive stack usage. This commit replaces the static\narray allocation with dynamic memory allocation using `kcalloc`,\nthereby reducing the stack size.\n\nThis change avoids the risk of stack overflows in kernel space,  in\nscenarios where `AMDGPU_MAX_QUEUES` is large. The  allocated memory is\nfreed using `kfree` before the function returns  to prevent memory\nleaks.\n\nFixes the below with gcc W=1:\ndrivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c: In function ‘kfd_get_cu_occupancy’:\ndrivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:322:1: warning: the frame size of 1056 bytes is larger than 1024 bytes [-Wframe-larger-than=]\n  322 | }\n      | ^","provenance":"source","from":"CVE.org"},"cvss":{"score":7.8,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CISA ADP Vulnrichment"},"epss":{"score":0.0032,"percentile":0.1745,"provenance":"source"},"cwes":[{"id":"CWE-787","name":"Out-of-bounds Write"}],"references":[{"url":"https://git.kernel.org/stable/c/6d9f07196389f35a3afebcf1a12c1425725caddd","tags":[]},{"url":"https://git.kernel.org/stable/c/922f0e00017b09d9d47e3efac008c8b20ed546a0","tags":[]}],"priority":{"score":8.9,"factors":[{"name":"EPSS percentile","points":3.49},{"name":"CVSS severity","points":5.46}]},"vendorSlug":"linux","affectedVersions":[{"vendor":"Linux","product":"Linux","versions":[">= 6ae9e1aba97e4cdaa31a0bfdc07497ad0e915c84, < 6d9f07196389f35a3afebcf1a12c1425725caddd",">= 6ae9e1aba97e4cdaa31a0bfdc07497ad0e915c84, < 922f0e00017b09d9d47e3efac008c8b20ed546a0"]},{"vendor":"Linux","product":"Linux","versions":["6.12"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2025-10-01T19:59:08.817572Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2024-53343","exploited":false,"provenance":"source"}}