fkie_cve-2024-56695
Vulnerability from fkie_nvd
Published
2024-12-28 10:15
Modified
2024-12-28 10:15
Severity ?
Summary
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 | }
| ^
References
Impacted products
Vendor | Product | Version |
---|
{ "cveTags": [], "descriptions": [ { "lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\ndrm/amdkfd: Use dynamic allocation for CU occupancy array in \u0027kfd_get_cu_occupancy()\u0027\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 \u2018kfd_get_cu_occupancy\u2019:\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 | ^" }, { "lang": "es", "value": "En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: drm/amdkfd: Uso de asignaci\u00f3n din\u00e1mica para la matriz de ocupaci\u00f3n de CU en \u0027kfd_get_cu_occupancy()\u0027 La funci\u00f3n `kfd_get_cu_occupancy` declar\u00f3 anteriormente una matriz `cu_occupancy` grande como una variable local, lo que podr\u00eda provocar desbordamientos de pila debido al uso excesivo de la pila. Esta confirmaci\u00f3n reemplaza la asignaci\u00f3n de matriz est\u00e1tica con asignaci\u00f3n de memoria din\u00e1mica utilizando `kcalloc`, lo que reduce el tama\u00f1o de la pila. Este cambio evita el riesgo de desbordamientos de pila en el espacio del kernel, en escenarios donde `AMDGPU_MAX_QUEUES` es grande. La memoria asignada se libera utilizando `kfree` antes de que la funci\u00f3n regrese para evitar fugas de memoria. Corrige lo siguiente con gcc W=1: drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c: En la funci\u00f3n \u0027kfd_get_cu_occupancy\u0027: drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:322:1: advertencia: el tama\u00f1o del marco de 1056 bytes es mayor que 1024 bytes [-Wframe-larger-than=] 322 | } | ^" } ], "id": "CVE-2024-56695", "lastModified": "2024-12-28T10:15:15.533", "metrics": {}, "published": "2024-12-28T10:15:15.533", "references": [ { "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "url": "https://git.kernel.org/stable/c/6d9f07196389f35a3afebcf1a12c1425725caddd" }, { "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "url": "https://git.kernel.org/stable/c/922f0e00017b09d9d47e3efac008c8b20ed546a0" } ], "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "vulnStatus": "Awaiting Analysis" }
Loading…
Loading…
Sightings
Author | Source | Type | Date |
---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.