CVE-2026-31765 Overview
CVE-2026-31765 is a Linux kernel vulnerability in the AMD GPU (amdgpu) Direct Rendering Manager (DRM) driver. The flaw stems from a size mismatch between AMDGPU_VA_RESERVED_TRAP_SIZE (hardcoded to 8KB) and KFD_CWSR_TBA_TMA_SIZE (defined as 2 * PAGE_SIZE). On systems with 64K page sizes, the Compute Wave Save Restore (CWSR) Trap Buffer Area / Trap Memory Area allocation grows to 128KB while the reserved trap region remains 8KB. This mismatch triggers a kernel NULL pointer dereference in __mutex_add_waiter when running workloads such as rocminfo or RCCL unit tests.
Critical Impact
Local unprivileged users on PowerPC and other 64K-page Linux systems with AMD GPUs can crash the kernel via standard ROCm ioctl calls, resulting in a denial of service.
Affected Products
- Linux kernel amdgpu DRM driver on architectures using 64K page size (e.g., PowerPC pSeries, certain ARM64 configurations)
- Kernel version 6.19.0-rc4 is referenced in the reported crash trace
- Systems running ROCm userspace tooling (rocminfo, RCCL) against AMD GPUs
Discovery Timeline
- 2026-05-01 - CVE-2026-31765 published to the National Vulnerability Database (NVD)
- 2026-05-01 - Last updated in NVD database
Technical Details for CVE-2026-31765
Vulnerability Analysis
The vulnerability resides in the AMD Kernel Fusion Driver (KFD) component of the amdgpu driver, which manages GPU virtual address (VA) space for compute workloads. The driver reserves a fixed trap region in each process's GPU VA space for the CWSR mechanism, used to save and restore wavefront state on preemption.
The constant AMDGPU_VA_RESERVED_TRAP_SIZE is hardcoded at 8KB. The companion buffer size KFD_CWSR_TBA_TMA_SIZE is computed as 2 * PAGE_SIZE. On 4K-page architectures the two values match. On 64K-page architectures, KFD_CWSR_TBA_TMA_SIZE evaluates to 128KB while the reserved area stays at 8KB, so the allocation overruns the reservation.
When rocminfo triggers kfd_ioctl_acquire_vm, the call path reaches amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu, which dereferences a mutex pointer that was never properly initialized for the oversized allocation. The result is a NULL pointer dereference inside __mutex_add_waiter+0x24/0xc0, taking down the kernel.
Root Cause
The root cause is an inconsistent assumption about page size between two related constants in the amdgpu KFD code. AMDGPU_VA_RESERVED_TRAP_SIZE is page-size agnostic and fixed at 8KB, while KFD_CWSR_TBA_TMA_SIZE scales with the host's PAGE_SIZE. The mismatch is a logic error rather than a memory-safety bug in the traditional sense, but the resulting allocation/reservation mismatch corrupts driver state and produces a NULL pointer dereference.
Attack Vector
Exploitation requires only local, unprivileged access to a system with an AMD GPU and a 64K-page kernel. The crash trace shows UID: 1001 invoking sys_ioctl through standard ROCm tooling. Any user with permission to open /dev/kfd and issue compute ioctls can trigger the kernel oops, producing a denial-of-service condition. There is no public evidence that the issue is exploitable for code execution or privilege escalation.
The vulnerability mechanism is described in prose because no proof-of-concept code is published. Refer to the upstream commits for the exact source change. See the kernel commit 4487571ef17a for the authoritative fix.
Detection Methods for CVE-2026-31765
Indicators of Compromise
- Kernel oops messages containing Kernel NULL pointer dereference on read at 0x00000002 with NIP: __mutex_add_waiter
- Call traces referencing amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu, kfd_process_device_init_cwsr_dgpu, or kfd_ioctl_acquire_vm
- Repeated crashes of rocminfo, RCCL test binaries, or other ROCm workloads on 64K-page hosts
- dmesg entries tagged exploit attempt? originating from non-root UIDs invoking KFD ioctls
Detection Strategies
- Inventory Linux hosts running amdgpu with getconf PAGE_SIZE returning 65536 and correlate against vulnerable kernel builds
- Monitor /var/log/kern.log and journalctl -k for amdgpu-related oops signatures matching the published crash trace
- Track unexpected reboots or kernel panics on PowerPC or ARM64 GPU compute nodes after ROCm jobs are launched
Monitoring Recommendations
- Forward kernel ring buffer events to a centralized log pipeline and alert on BUG: and Oops: strings tied to amdgpu
- Baseline the frequency of kfd_ioctl calls per user and flag crashes correlated with specific UIDs
- Subscribe to distribution security advisories for the kernel package and validate that GPU compute hosts receive timely updates
How to Mitigate CVE-2026-31765
Immediate Actions Required
- Apply the upstream kernel patches that change AMDGPU_VA_RESERVED_TRAP_SIZE to 64KB and align KFD_CWSR_TBA_TMA_SIZE to the AMD GPU page size
- Restrict access to /dev/kfd and /dev/dri/* to trusted users on affected hosts until patches are deployed
- Pause ROCm-based compute workloads on 64K-page kernels where the fix has not yet landed
Patch Information
The fix is delivered through cherry-picked commit 31b8de5e55666f26ea7ece5f412b83eab3f56dbb and is present in the following stable backports: 4487571ef17a, 6b2614a0ff05, 77c918eaa4c9, and d3508cf822c4. The patch reserves 64KB for the trap region in the GPU VA space while still allocating only 8KB inside it, ensuring the allocation never exceeds the reservation regardless of host page size.
Workarounds
- Run affected GPU compute workloads on 4K-page kernels (most x86_64 distributions) where the size mismatch does not occur
- Block or unload the amdgpu module on 64K-page hosts that do not require GPU acceleration
- Use Linux Control Groups (cgroups) device controllers to deny untrusted users access to KFD and DRM devices
# Verify host page size and kernel version before deciding on remediation
getconf PAGE_SIZE
uname -r
# Restrict access to the AMD KFD device until the kernel is patched
sudo chgrp gpu-compute /dev/kfd /dev/dri/render*
sudo chmod 0660 /dev/kfd /dev/dri/render*
# Optionally blacklist amdgpu on 64K-page hosts that do not need GPU compute
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.

