What’s Vulnerable › Vulnerabilities
CVE-2024-56695: drm/amdkfd: Use dynamic allocation for CU occupancy array in 'kfd_get_cu_occupancy()'
- Severity: high (CVSS 7.8 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.2% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2024-12-28 · updated 2026-06-17
- Weakness: CWE-787
Description
In the Linux kernel, the following vulnerability has been resolved: drm/amdkfd: Use dynamic allocation for CU occupancy array in 'kfd_get_cu_occupancy()' The `kfd_get_cu_occupancy` function previously declared a large `cu_occupancy` array as a local variable, which could lead to stack overflows due to excessive stack usage. This commit replaces the static array allocation with dynamic memory allocation using `kcalloc`, thereby reducing the stack size. This change avoids the risk of stack overflows in kernel space, in scenarios where `AMDGPU_MAX_QUEUES` is large. The allocated memory is freed using `kfree` before the function returns to prevent memory leaks. Fixes the below with gcc W=1: drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c: In function ‘kfd_get_cu_occupancy’: drivers/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=] 322 | } | ^
Affected products
- Linux kernel: from 6.12 before 6.12.2 — fixed in 6.12.2
How to fix
Upgrade to a fixed version: Linux kernel 6.12.2. Check the vendor advisory for mitigations.
References
- https://git.kernel.org/stable/c/6d9f07196389f35a3afebcf1a12c1425725caddd
- https://git.kernel.org/stable/c/922f0e00017b09d9d47e3efac008c8b20ed546a0
Get alerted when CVE-2024-56695 or the next vulnerability affects your stack