In the Linux kernel, the following vulnerability has been resolved: drm/amd/display: take a runtime PM reference only when a CRTC turns on amdgpu_dm_commit_streams() takes a runtime PM reference for every active CRTC that needs a modeset and has a new stream, but amdgpu_dm_atomic_commit_tail() drops one only for each CRTC that goes from active to inactive. A modeset of a CRTC that is already active (a mode change, or anything else that needs a full modeset) therefore leaks one reference. Once that has happened, the usage count no longer returns to zero with every CRTC off, and the device cannot runtime suspend again until reboot. The two also disagree the other way when a CRTC turns on without a stream ("Failed to create new stream"): no reference is taken, but one is dropped when it turns off. Take the reference in the loop that counts the disabled CRTCs, on the mirror condition: when the CRTC goes from inactive to active, which is what the commit that added it intended ("every time we enable a previously disabled CRTC"). Each active CRTC then holds exactly one reference. Tested on an RX 9070 XT (Navi 48) over OCuLink, with the change backported to 7.2.9: an unplugged connector forced on, then mode A on a CRTC, mode B on the same active CRTC, and the CRTC off, three rounds in a row. The usage count rose by 3 with the stock module, by 0 with this patch, and by 3 again after reloading the stock module. (cherry picked from commit 59ef9a435499777b8e1c4e0eff52f813c64fb920)
https://git.kernel.org/stable/c/feb795e02f471cd85e880582c92e7f89fef41160
https://git.kernel.org/stable/c/fc0da79020463bbea6658766127b8efa191ec881
https://git.kernel.org/stable/c/ee8e4eae1eabc7717f11a9c511d248019a682f9a
https://git.kernel.org/stable/c/ec01397e6c4082f78e1a40e0baff7c8979653dda
https://git.kernel.org/stable/c/bdea56cbdfd91d7c2743a69455a9fd9ba5da506d
https://git.kernel.org/stable/c/b456f591f925fbd6b33770d0eec1b51c2f9d41c1
https://git.kernel.org/stable/c/4be3d15d3b2f6e596c11ee3c0b287477dc2a8b41
https://git.kernel.org/stable/c/436c89a46b451f5da9259ab31b2524fe694b6a2a