drm/amd: Fix NULL pointer dereference in device cleanup
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/amd: Fix NULL pointer dereference in device cleanup
When GPU initialization fails due to an unsupported HW block IP blocks may have a NULL version pointer. During cleanup in amdgpu_device_fini_hw, the code calls amdgpu_device_set_pg_state and amdgpu_device_set_cg_state which iterate over all IP blocks and access adev->ip_blocks[i].version without NULL checks, leading to a kernel NULL pointer dereference.
Add NULL checks for adev->ip_blocks[i].version in both amdgpu_device_set_cg_state and amdgpu_device_set_pg_state to prevent dereferencing NULL pointers during GPU teardown when initialization has failed.
(cherry picked from commit b7ac77468cda92eecae560b05f62f997a12fe2f2)
From the CVE record · Linux
The Linux kernel’s AMD GPU cleanup code can dereference a NULL pointer when GPU initialization fails because of an unsupported hardware block. This can cause a kernel fault during GPU teardown; the input does not specify an attacker path, authentication requirement, or user interaction.
Engineers running Linux kernels with AMD GPU support should check their versions; affected versions are not specified.