drm/amdgpu: Fix the memory allocation issue in amdgpu_discovery_get_nps_info()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
6.11.116.12.26.13In 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.
From the CVE record · Linux
The Linux kernel's amdgpu_discovery_get_nps_info() did not check whether memory allocation failed and did not guard against multiplication overflow when allocating memory ranges. An allocation failure could lead to a null pointer dereference. The input does not specify an attack path, authentication requirements, or user interaction.
Engineers running Linux kernels with the amdgpu driver should check their systems; affected versions are not specified.