CVE-2024-56695
Severity CVSS v4.0:
Pending analysis
Type:
CWE-787
Out-of-bounds Write
Publication date:
28/12/2024
Last modified:
01/10/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
drm/amdkfd: Use dynamic allocation for CU occupancy array in &#39;kfd_get_cu_occupancy()&#39;<br />
<br />
The `kfd_get_cu_occupancy` function previously declared a large<br />
`cu_occupancy` array as a local variable, which could lead to stack<br />
overflows due to excessive stack usage. This commit replaces the static<br />
array allocation with dynamic memory allocation using `kcalloc`,<br />
thereby reducing the stack size.<br />
<br />
This change avoids the risk of stack overflows in kernel space, in<br />
scenarios where `AMDGPU_MAX_QUEUES` is large. The allocated memory is<br />
freed using `kfree` before the function returns to prevent memory<br />
leaks.<br />
<br />
Fixes the below with gcc W=1:<br />
drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c: In function ‘kfd_get_cu_occupancy’:<br />
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=]<br />
322 | }<br />
| ^
Impact
Base Score 3.x
7.80
Severity 3.x
HIGH
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.12 (including) | 6.12.2 (excluding) |
To consult the complete list of CPE names with products and versions, see this page



