CVE-2024-56697 drm/amdgpu: Fix the memory allocation issue in amdgpu_discovery_get_nps_info()
A missing null check in the amdgpu driver can cause a kernel crash when memory allocation fails, leading to denial of service.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-56697?
CVE-2024-56697 is a medium-severity vulnerability in Linux kernel, published on 28 Dec 2024. It can only be exploited from the same machine or local network, with no action from the victim.
Official 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.
Weakness: CWE-476
Which versions are affected by CVE-2024-56697?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2024-56697?
Apply the vendor's patch.
Is CVE-2024-56697 being exploited?
There is no known exploitation of CVE-2024-56697 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as BELL-CVE-2024-56697, DEBIAN-CVE-2024-56697, GHSA-6779-v6gp-jmxv, UBUNTU-CVE-2024-56697.