Executive brief
The Linux kernel's AMD GPU video encode driver (amdgpu VCN4) contained a time-of-check-time-of-use (TOCTOU) vulnerability where instruction buffer parameters were read twice, allowing an attacker to change the buffer contents between reads. An attacker with access to trigger GPU encoding operations could exploit this to cause memory corruption or potentially achieve arbitrary code execution on systems running vulnerable kernel versions.
Technical details
The vulnerability is a TOCTOU (time-of-check-time-of-use) race condition in the amdgpu VCN4 encoding path, specifically in the vcn_v4_0_enc_find_ib_param() function and its caller vcn_v4_0_ring_patch_cs_in_place(). The function reads an instruction buffer (IB) parameter length value, returns the offset to the caller, and the caller then re-reads the same length value from the IB. If a malicious or racing process modifies the IB contents between these two reads, the code would use inconsistent length values, leading to out-of-bounds memory access. The fix reuses the length value returned by the helper function instead of re-reading it from memory, eliminating the race window. No authentication is required; any user able to submit GPU encoding commands can trigger this.
Affected products
- Linux Linux kernel 4.x through 6.x (amdgpu drm module)
Timeline
- 2026-08-10: disclosed: CVE-2026-68107 published
- 2026-05-21: patched: Fix committed by Boyuan Zhang