CVE-2026-99621: drm/amdgpu: unlock the VM and BO when attaching a KFD BO fails
In the Linux kernel, the following vulnerability has been resolved:
drm/amdgpu: unlock the VM and BO when attaching a KFD BO fails
kfdmemattach() locks the page directory and the BO with a drmexec transaction on its stack, but leaves through the unwind label without drmexecfini() when locking fails, e.g. when MAPMEMORYTOGPU gets a signal while the page directory or the BO is busy. Reservations already acquired then remain locked with their wwacquirectx pointing into the expired stack frame.
With one thread doing GEMVA map/unmap on the KFD VM and another one mapping KFD BOs while getting SIGUSR1 every 20 us:
BUG: KASAN: stack-out-of-bounds in wwmutexlock.constprop.0+0x34f5/0x3da0 wwmutexlockinterruptible+0x2f/0x150 drmexeclockobj+0x107/0x2d0 [drmexec] kfdmemattach+0x4dd/0x1b60 [amdgpu]
and the process ends up in D state.
Finish the transaction before unwinding.
(cherry picked from commit 7b885fa27e4b9fa5cbdc64e66fc35872aee296f5)
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.5 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Patch 7b885fa27e4b9fa5cbdc64e66fc35872aee296f5
Frequently Asked Questions
What activity can trigger the failure?
The failure can occur when kfd_mem_attach() is interrupted while trying to lock the page directory or buffer object, such as when MAP_MEMORY_TO_GPU receives a signal while either object is busy. The reported reproducer combines GEM_VA map/unmap activity on a KFD VM with concurrent KFD BO mappings and frequent SIGUSR1 delivery.
How can an affected system be recognized?
Affected systems may report a KASAN stack-out-of-bounds error in __ww_mutex_lock or ww_mutex_lock_interruptible, with kfd_mem_attach and drm_exec_lock_obj in the call trace. The affected process can also become stuck in D state.