drm/amdgpu: Use kvfree instead of kfree in amdgpu_gmc_get_nps_memranges()
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 |
|
|
In the Linux kernel, the following vulnerability has been resolved:
drm/amdgpu: Use kvfree instead of kfree in amdgpu_gmc_get_nps_memranges()
amdgpu_discovery_get_nps_info() internally allocates memory for ranges using kvcalloc(), which may use vmalloc() for large allocation. Using kfree() to release vmalloc memory will lead to a memory corruption.
Use kvfree() to safely handle both kmalloc and vmalloc allocations.
Compile tested only. Issue found using a prototype static analysis tool and code review.
From the CVE record · Linux
The Linux kernel's amdgpu driver can corrupt memory when it frees a large allocation in amdgpu_gmc_get_nps_memranges() with kfree() instead of kvfree(). The input does not establish how an attacker could trigger this or whether network access, authentication, or user interaction is required. The issue was found through static analysis and code review and was only compile tested.
Engineers running Linux kernels with the amdgpu driver should check their versions; affected versions are not specified.