Linux: drm/amdgpu: serialize vblank counter reads against GPU reset
What fixes it
- 037796d9ca1da97978deaefd88ca5649f6cb69f5LinuxCVE List
- 11b6193c8841a052b7907006ffb1e02468b1448eLinuxCVE List
- 8d6f773d7479034a574ecc3b585bcd07d46b4824LinuxCVE List
- 1a6023edfbb5673f55fab6348f135fb3b1428ea5LinuxCVE List
- 6.6.160LinuxCVE List
- 6.12.113LinuxCVE List
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
Description
In the Linux kernel, the following vulnerability has been resolved:
drm/amdgpu: serialize vblank counter reads against GPU reset
The vblank counter callback reads display registers and scanout position without holding reset_domain->sem. During GPU recovery, display commit work can call the callback while reset owns the semaphore for writing. The hardware access then triggers the lockdep_assert_held() in amdgpu_device_skip_hw_access() and sets TAINT_WARN when lockdep is enabled.
Try to acquire the reset semaphore for reading before accessing the hardware, and hold it across the counter and scanout-position reads. If reset is already in progress, return DRM's cached software vblank count instead. This avoids blocking behind reset and avoids accessing display hardware while it is being reset.
The cached count is less accurate than the hardware count, but is used only when reset prevents a safe hardware read. This addresses the reset-time warning from this vblank path; it does not suppress or fix unrelated lockdep warnings.
(cherry picked from commit 51a4359f7431a4be5e42803c8bdaf7e0e5be2934)
Text from CVE List
Affected versions 14
- Linuxaffected: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before 037796d9ca1da97978deaefd88ca5649f6cb69f5CVE List
- Linuxaffected: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before 11b6193c8841a052b7907006ffb1e02468b1448eCVE List
- Linuxaffected: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before 8d6f773d7479034a574ecc3b585bcd07d46b4824CVE List
- Linuxaffected: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before f4a0a1ce147d1a6e428d7cb5e3b99fd695139fc7CVE List
- Linuxaffected: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 before 1a6023edfbb5673f55fab6348f135fb3b1428ea5CVE List
- Linuxaffected: all versions before 6.6.160CVE List
- Linuxaffected: all versions before 6.12.113CVE List
- Linuxaffected: all versions before 6.18.57CVE List
- Linuxaffected: all versions before 7.2.11CVE List
- Linuxunaffected: 6.6.160 through 6.6.*CVE List
- Linuxunaffected: 6.12.113 through 6.12.*CVE List
- Linuxunaffected: 6.18.57 through 6.18.*CVE List
- Linuxunaffected: 7.2.11 through 7.2.*CVE List
- Linuxunaffected: 7.3CVE List
References 5
- git.kernel.org/stable/c/037796d9ca1da97978deaefd88ca5649f6cb69f5Referencevia CVE List
- git.kernel.org/stable/c/11b6193c8841a052b7907006ffb1e02468b1448eReferencevia CVE List
- git.kernel.org/stable/c/8d6f773d7479034a574ecc3b585bcd07d46b4824Referencevia CVE List
- git.kernel.org/stable/c/f4a0a1ce147d1a6e428d7cb5e3b99fd695139fc7Referencevia CVE List
- git.kernel.org/stable/c/1a6023edfbb5673f55fab6348f135fb3b1428ea5Referencevia CVE List