# CVE-2024-56697: drm/amdgpu: Fix the memory allocation issue in amdgpu_discovery_get_nps_info()

- Severity: Medium 5.5 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.21%, higher than 11% of CVEs (2026-12-01)
- Published: 2024-12-28T09:46:20.728Z
- Modified: 2026-06-17T08:12:46.220Z
- Weaknesses: CWE-476
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

drm/amdgpu: Fix the memory allocation issue in amdgpu_discovery_get_nps_info()

Fix two issues with memory allocation in amdgpu_discovery_get_nps_info()
for mem_ranges:

 - Add a check for allocation failure to avoid dereferencing a null
   pointer.

 - As suggested by Christophe, use kvcalloc() for memory allocation,
   which checks for multiplication overflow.

Additionally, assign the output parameters nps_type and range_cnt after
the kvcalloc() call to prevent modifying the output parameters in case
of an error return.

(As written by CVE List.)

## Affected

- Linux Linux: from b194d21b9bcc15b50df1bc3ff7428e51c2918a6f before d14bea4e094871226ea69772d69dab8b7b5f4915; from b194d21b9bcc15b50df1bc3ff7428e51c2918a6f before e8f1dbaa0437eba4e8c1d6a6d81eca2e2ce3d197; from b194d21b9bcc15b50df1bc3ff7428e51c2918a6f before a1144da794adedb9447437c57d69add56494309d; 6.11 (not affected: before 6.11; from 6.11.11 up to 6.11.*; from 6.12.2 up to 6.12.*; from 6.13 up to *)
- linux linux_kernel: from 6.11 before 6.11.11; from 6.12 before 6.12.2

## Every score

- CISA-ADP: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://git.kernel.org/stable/c/d14bea4e094871226ea69772d69dab8b7b5f4915> (patch)
- <https://git.kernel.org/stable/c/e8f1dbaa0437eba4e8c1d6a6d81eca2e2ce3d197> (patch)
- <https://git.kernel.org/stable/c/a1144da794adedb9447437c57d69add56494309d> (patch)

## Sources

- CVE List: [CVE-2024-56697](https://www.cve.org/CVERecord?id=CVE-2024-56697), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2024-56697](https://nvd.nist.gov/vuln/detail/CVE-2024-56697), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-56697 · Whole record: https://cve.day/CVE-2024-56697.json · Rebuilt by cve.day 2026-11-25T22:58:50.537Z
