CVE-2026-80919: drm/amdgpu: fix recursive ww_mutex acquire in amdgpu_devcoredump_format
In the Linux kernel, the following vulnerability has been resolved:
drm/amdgpu: fix recursive wwmutex acquire in amdgpudevcoredumpformat
When dumping IB contents from a hung job, amdgpudevcoredumpformat() acquired the VM root PD's reservation via amdgpuvmlockbypasid() and then, for each IB, called amdgpuboreserve() on the BO backing the IB. Both reservations are reservationwwclassmutex objects and neither used a wwacquirectx, which trips lockdep:
WARNING: possible recursive locking detected -------------------------------------------- kworker/u128:0 is trying to acquire lock: ffff88838b16e1f0 (reservationwwclassmutex){+.+.}-{4:4}, at: amdgpudevcoredumpformat+0x1594/0x23f0 [amdgpu]
but task is already holding lock: ffff8882f82681f0 (reservationwwclassmutex){+.+.}-{4:4}, at: amdgpudevcoredumpformat+0x1594/0x23f0 [amdgpu]
Possible unsafe locking scenario: CPU0 ---- lock(reservationwwclassmutex); lock(reservationwwclassmutex);
DEADLOCK May be due to missing lock nesting notation
Workqueue: eventsunbound amdgpudevcoredumpdeferredwork [amdgpu] Call Trace: wwmutexlock.constprop.0 wwmutexlock amdgpuboreserve amdgpudevcoredumpformat+0x1594 [amdgpu] amdgpudevcoredumpdeferredwork+0xea [amdgpu]
The two reservations are on different BOs in the captured trace, so the splat is a lockdep-correctness warning, not an observed deadlock. It becomes a real self-deadlock whenever the IB BO shares its dmaresv with the root PD (the always-valid case, see amdgpuvmisboalwaysvalid()): amdgpuboreserve(abo) re-acquires the same wwmutex without a ticket and blocks forever. With amdgpu.gpurecovery=0 the timeout handler refires every ~2 s and each invocation produces this splat, drowning the kernel ring buffer.
Now that amdgpuvmlockbypasid() takes a drmexec context, move the IB dumping into a separate helper that locks the root PD and every IB BO together in a single drmexec ticket. DRMEXECIGNOREDUPLICATES handles IB BOs that share a dmaresv (e.g. always-valid BOs, or two IBs backed by the same BO). Every lock is now a top-level acquire under one wwacquirectx, so the recursive wwmutex condition is gone, and the per-IB amdgpuboreserve()/amdgpubounref() dance -- including a BO refcount leak on the amdgpuboreserve() failure path -- is removed.
(cherry picked from commit d6bf4242731219ee08ce54c365631e395486651e)
Affected Software
Event History
Frequently Asked Questions
What systems are exposed to this issue?
Systems using the Linux kernel amdgpu driver are affected when the driver formats a device core dump for a hung GPU job and dumps instruction-buffer contents.
What condition triggers the locking problem?
The issue occurs when amdgpu_devcoredump_format() locks the VM root page-directory reservation and then reserves the buffer object backing each instruction buffer. These are both reservation_ww_class_mutex locks acquired without a ww_acquire_ctx.
How can I identify a potentially affected system?
Lockdep may report a “possible recursive locking detected” warning involving reservation_ww_class_mutex, amdgpu_devcoredump_format(), amdgpu_bo_reserve(), and the amdgpu_devcoredump_deferred_work workqueue. The warning describes a possible deadlock scenario.
What fix information is available?
The provided references identify stable kernel commits 4e9b4dee0777ec9c835a4746e2d30382dd9d1044 and 7152b248dc3c8d5fa8629e99ed5655dd41b51562. No affected or fixed kernel version numbers are provided.