CVE-2026-89809: drm/amdkfd: fix scope of mqd_mgr dereference in pqm_debugfs_mqds
In the Linux kernel, the following vulnerability has been resolved:
drm/amdkfd: fix scope of mqdmgr dereference in pqmdebugfsmqds
Reading /sys/kernel/debug/kfd/mqds while a process holds an active KFD queue triggers a NULL pointer dereference because the for loop that calls mqdmgr->debugfsshowmqd() is incorrectly placed outside the if (pqn->q) block that initializes mqdmgr.
The queue list can contain entries where pqn->q is NULL (kernel queues where only pqn->kq is valid). In the original code:
if (pqn->q) { ... mqdmgr = q->device->dqm->mqdmgrs[mqdtype]; size = mqdmgr->mqdstride(...); }
for (xcc = 0; xcc < numxccs; xcc++) { // WRONG: outside if block mqd = q->mqd + size xcc; r = mqdmgr->debugfsshowmqd(m, mqd); }
When iterating over a queue node where pqn->q is NULL: 1. The if (pqn->q) block is skipped 2. mqdmgr remains uninitialized (NULL from declaration) 3. The for loop executes anyway 4. mqdmgr->debugfsshowmqd(m, mqd) dereferences NULL
The crash manifests as:
BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor instruction fetch in kernel mode RIP: 0010:0x0 Call Trace: pqmdebugfsmqds+0x10c/0x1d0 [amdgpu] kfddebugfsmqdsbyprocess+0x9b/0x110 [amdgpu] seqreaditer+0x132/0x4b0 ...
Fix by moving the for loop inside the if (pqn->q) block, so mqdmgr and related variables are only used when properly initialized.
(cherry picked from commit 8bfe29d5c798940f797aa24135d2734c3ffce9de)
Affected Software
Event History
Frequently Asked Questions
What conditions are required to trigger the crash?
A process must hold an active KFD queue, and /sys/kernel/debug/kfd/mqds must be read while the queue list contains a kernel-queue entry for which pqn->q is NULL and only pqn->kq is valid.
What is the practical impact of successful triggering?
The affected debugfs read can cause a kernel NULL pointer dereference in pqm_debugfs_mqds, resulting in a kernel crash.
How can I tell whether this issue has occurred?
Look for a kernel NULL pointer dereference with pqm_debugfs_mqds in the call trace, potentially preceded by reading /sys/kernel/debug/kfd/mqds. The reported crash includes an instruction-fetch fault at address 0x0.