CVE-2026-31566 Overview
CVE-2026-31566 is a use-after-free vulnerability [CWE-416] in the Linux kernel's AMD GPU driver (drm/amdgpu). The flaw resides in the amdgpu_amdkfd_submit_ib() function, which submits a GPU job and obtains a fence reference from amdgpu_ib_schedule(). The function calls dma_fence_put() before dma_fence_wait(), potentially releasing the last reference and freeing the fence before it is waited on. A local user with permission to submit GPU work can trigger memory corruption in kernel space. The vulnerability affects multiple Linux kernel branches and has been patched across stable trees.
Critical Impact
Local attackers with GPU access can trigger a use-after-free in kernel context, leading to memory corruption, denial of service, or potential local privilege escalation on systems using AMD GPUs.
Affected Products
- Linux kernel 6.0
- Linux kernel 7.0 release candidates (rc1 through rc7)
- Linux distributions shipping the affected amdgpu kernel driver
Discovery Timeline
- 2026-04-24 - CVE-2026-31566 published to NVD
- 2026-04-27 - Last updated in NVD database
Technical Details for CVE-2026-31566
Vulnerability Analysis
The vulnerability lives in drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c at line 697. The function amdgpu_amdkfd_submit_ib() submits an indirect buffer (IB) to the GPU through amdgpu_ib_schedule() and receives a dma_fence pointer used to signal job completion.
The code releases the fence reference with dma_fence_put() before invoking dma_fence_wait() on the same pointer. When the dma_fence_put() call drops the last reference, the kernel frees the fence object. The subsequent dma_fence_wait() then dereferences memory that has already been freed, producing a classic use-after-free condition in kernel context.
Static analysis flagged this as: amdgpu_amdkfd_submit_ib() warn: passing freed memory 'f' (line 696). The fix reorders operations so dma_fence_wait() runs first and dma_fence_put() only afterward.
Root Cause
The root cause is incorrect reference-count lifecycle management on a DMA fence object. The driver violated the invariant that an object must remain referenced for the duration of any access. Releasing the reference before completing the wait creates a window where the fence backing memory can be reclaimed and reused by another kernel allocation.
Attack Vector
Exploitation requires local access with privileges to interact with the AMD GPU device through KFD (Kernel Fusion Driver) interfaces. An attacker submits GPU work that triggers the vulnerable submit path. Successful exploitation depends on winning a race to reclaim the freed fence memory with attacker-controlled data before dma_fence_wait() dereferences it. No verified public proof-of-concept exists, and EPSS scoring indicates low near-term exploitation probability.
No verified exploitation code is available. See the upstream kernel commits referenced below for the patch diff and technical context.
Detection Methods for CVE-2026-31566
Indicators of Compromise
- Kernel oops or panic messages referencing amdgpu_amdkfd_submit_ib, dma_fence_wait, or dma_fence_put in dmesg or journalctl -k output
- KASAN (Kernel Address Sanitizer) reports flagging use-after-free in the amdgpu driver path
- Unexpected GPU driver resets or compute job failures originating from KFD ioctl callers
Detection Strategies
- Audit running kernel version with uname -r and compare against patched stable releases listed in the kernel.org commits
- Enable KASAN on test kernels to surface fence lifecycle violations during fuzzing of /dev/kfd and /dev/dri/render*
- Monitor for non-root processes opening KFD device nodes followed by abnormal kernel log entries
Monitoring Recommendations
- Forward kernel logs to a centralized logging pipeline and alert on oops traces containing amdgpu_amdkfd symbols
- Track local privilege escalation attempts and anomalous process behavior on hosts equipped with AMD GPUs, particularly compute and ML workstations
- Inventory endpoints running unpatched 6.x and 7.0-rc kernels with AMD hardware as priority remediation targets
How to Mitigate CVE-2026-31566
Immediate Actions Required
- Apply the upstream stable kernel patches and reboot affected systems
- Identify hosts with AMD GPUs running affected kernel versions and prioritize them for patching
- Restrict local access to systems exposing /dev/kfd and DRM render nodes until patching completes
Patch Information
The fix reverses the order of dma_fence_wait() and dma_fence_put() so the wait completes while the reference is still held. Stable backports are available in the following commits:
- Kernel Patch 138e42b
- Kernel Patch 3982086
- Kernel Patch 42d2487
- Kernel Patch 7150850
- Kernel Patch bc7760c1
- Kernel Patch e23602eb
The upstream fix is cherry-picked from commit 8b9e5259adc385b61a6590a13b82ae0ac2bd3482.
Workarounds
- Unload the amdgpu kernel module on systems where AMD GPU functionality is not required
- Restrict KFD device node access to trusted users by tightening permissions on /dev/kfd and /dev/dri/render*
- Disable ROCm and GPU compute workloads on unpatched hosts until the kernel update is deployed
# Verify current kernel version and check for amdgpu module
uname -r
lsmod | grep amdgpu
# Restrict access to KFD device node as a temporary mitigation
sudo chmod 0600 /dev/kfd
sudo chown root:root /dev/kfd
# Optionally blacklist amdgpu where not required
echo 'blacklist amdgpu' | sudo tee /etc/modprobe.d/blacklist-amdgpu.conf
sudo update-initramfs -u
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

