{"id":"CVE-2024-56695","aliases":["CVE-2024-56695"],"related":[],"kind":"vulnerability","state":"published","title":"drm/amdkfd: Use dynamic allocation for CU occupancy array in 'kfd_get_cu_occupancy()'","summary":"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      | ^","summarySource":"cvelist","descriptions":[{"lang":"en","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      | ^","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: drm/amdkfd: Uso de asignación dinámica para la matriz de ocupación de CU en 'kfd_get_cu_occupancy()' La función `kfd_get_cu_occupancy` declaró anteriormente una matriz `cu_occupancy` grande como una variable local, lo que podría provocar desbordamientos de pila debido al uso excesivo de la pila. Esta confirmación reemplaza la asignación de matriz estática con asignación de memoria dinámica utilizando `kcalloc`, lo que reduce el tamaño 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ón 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ón 'kfd_get_cu_occupancy': drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:322:1: advertencia: el tamaño del marco de 1056 bytes es mayor que 1024 bytes [-Wframe-larger-than=] 322 | } | ^","source":"nvd"}],"published":"2024-12-28T09:46:19.468Z","modified":"2026-06-17T08:12:45.917Z","severity":{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":["CWE-787"],"affected":[{"ranges":[{"type":"git","introduced":"6ae9e1aba97e4cdaa31a0bfdc07497ad0e915c84","fixed":"6d9f07196389f35a3afebcf1a12c1425725caddd","status":"affected"},{"type":"git","introduced":"6ae9e1aba97e4cdaa31a0bfdc07497ad0e915c84","fixed":"922f0e00017b09d9d47e3efac008c8b20ed546a0","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.12","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.12","status":"unaffected"},{"type":"semver","introduced":"6.12.2","lastAffected":"6.12.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.13","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"6.12","fixed":"6.12.2"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/6d9f07196389f35a3afebcf1a12c1425725caddd","tags":["mailing-list","patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/922f0e00017b09d9d47e3efac008c8b20ed546a0","tags":["mailing-list","patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2025-10-01T19:59:08.817Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-56695","url":"https://www.cve.org/CVERecord?id=CVE-2024-56695","licence":"CVE Terms of Use","modified":"2026-05-11T20:57:27.850Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-56695","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-56695","licence":"Public domain","modified":"2026-06-17T08:12:45.917Z"}],"updatedAt":"2026-11-25T22:58:50.536Z","epss":{"score":0.00217,"percentile":0.12914,"date":"2026-12-01T12:00:22.000Z"}}