Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-68257

CVE-2026-68257: Linux Kernel Buffer Overflow Vulnerability

CVE-2026-68257 is a buffer overflow flaw in the Linux kernel's AMD KFD driver that causes 32-bit integer overflow in CWSR size calculations. This article covers technical details, affected versions, impact, and mitigation.

Published:

CVE-2026-68257 Overview

CVE-2026-68257 is an integer overflow vulnerability in the Linux kernel's AMD Kernel Fusion Driver (drm/amdkfd). The flaw exists in the Control and Wave Save/Restore (CWSR) total size calculation used by GPU compute queue management. The variable total_cwsr_size was computed in 32-bit before being passed as a Buffer Object (BO) or Shared Virtual Memory (SVM) allocation size. When large ctx_save_restore_area_size and debug_memory_size values are multiplied by the XCC count, the arithmetic can wrap, yielding an undersized save area that firmware later overruns.

Critical Impact

A local user with GPU compute access can trigger an undersized kernel allocation, leading to firmware-driven out-of-bounds writes with high confidentiality, integrity, and availability impact.

Affected Products

  • Linux kernel drm/amdkfd (AMD Kernel Fusion Driver) subsystem
  • Systems using AMD GPUs with CWSR-capable compute queues (multi-XCC configurations)
  • Distributions shipping kernel versions prior to the upstream fix commits

Discovery Timeline

  • 2026-08-10 - CVE-2026-68257 published to NVD
  • 2026-08-13 - Last updated in NVD database

Technical Details for CVE-2026-68257

Vulnerability Analysis

The vulnerability resides in the CWSR area sizing logic within kfd_queue_acquire_buffers() and kfd_queue_release_buffers() in the AMD KFD driver. CWSR is the mechanism used to save and restore GPU compute wavefront state during context switches and debugging. The driver calculates a total size by multiplying ctx_save_restore_area_size and debug_memory_size by the number of XCC (Accelerator Complex Die) instances. Because total_cwsr_size was declared as a 32-bit type, sufficiently large per-XCC sizes combined with a high XCC count cause the multiplication to overflow the 32-bit range. The truncated result is then passed to the BO or SVM allocator, which returns a buffer smaller than the firmware expects. The firmware subsequently writes wavefront save data past the end of the allocation, corrupting adjacent kernel memory.

Root Cause

The root cause is a numeric truncation error [CWE-190 class] where arithmetic on user-influenced size parameters occurs in a 32-bit width before being used as an allocation length. No overflow guard existed on the multiplication or addition prior to the fix.

Attack Vector

Exploitation requires local access and low privileges consistent with a user account that can open the KFD device and submit compute queue configuration requests. No user interaction is required. An attacker crafts queue parameters that trigger the 32-bit wrap, causing the kernel to allocate an undersized CWSR buffer. When GPU firmware writes save state into that buffer, it corrupts kernel memory beyond the allocation boundary, enabling potential privilege escalation or denial of service.

No public proof-of-concept code is available. See the upstream patches referenced below for the precise arithmetic paths involved.

Detection Methods for CVE-2026-68257

Indicators of Compromise

  • Unexpected kernel oops or panic messages referencing amdkfd, kfd_queue_acquire_buffers, or CWSR save/restore paths
  • GPU firmware faults or hangs correlated with compute workload submission from unprivileged users
  • Memory corruption signatures such as KASAN reports flagging out-of-bounds writes within the KFD BO/SVM allocations

Detection Strategies

  • Audit kernel logs (dmesg, journalctl -k) for amdgpu and amdkfd errors following untrusted local workloads
  • Inventory running kernel versions across Linux hosts with AMD accelerators and compare against fixed commit hashes: 2b0386d42939, 865532d54eb5, abce3276c57e, b88ffe659360
  • Monitor for local users invoking ioctls on /dev/kfd with unusually large ctx_save_restore_area_size or debug_memory_size values

Monitoring Recommendations

  • Collect kernel telemetry and GPU driver logs into a centralized log platform for correlation with user session activity
  • Alert on repeated KFD queue creation failures or firmware reset events on hosts with AMD MI-series accelerators
  • Track process lineage for workloads accessing the KFD device to identify anomalous local exploitation attempts

How to Mitigate CVE-2026-68257

Immediate Actions Required

  • Apply vendor-supplied kernel updates that incorporate the upstream fix promoting total_cwsr_size to u64 and adding check_add_overflow() and check_mul_overflow() guards
  • Restrict access to /dev/kfd to trusted users and service accounts where full multi-tenant GPU compute is not required
  • Prioritize patching on multi-tenant HPC, AI training, and shared workstation hosts where local attackers are in scope

Patch Information

The fix promotes total_cwsr_size from 32-bit to u64 and validates the multiplication and addition using check_mul_overflow() and check_add_overflow() in both kfd_queue_acquire_buffers() and kfd_queue_release_buffers(). Upstream commits are available at Kernel Git Commit 2b0386d42939, Kernel Git Commit 865532d54eb5, Kernel Git Commit abce3276c57e, and Kernel Git Commit b88ffe659360. Consult your distribution's security tracker for the corresponding backported package.

Workarounds

  • Where patching is delayed, remove or tighten permissions on the /dev/kfd device node so only vetted service accounts can submit compute queues
  • Disable AMD KFD compute functionality on hosts that do not require GPU compute by unloading or blacklisting the amdkfd code path where feasible
  • Enforce resource quotas and cgroup isolation on interactive users to limit exposure of GPU compute interfaces

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.