CVE-2026-99633: drm/amdgpu: keep the CS user fence BO in GTT
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
drm/amdgpu: keep the CS user fence BO in GTT
The CS ioctl hands the GPU the GART address of the user fence BO, but since the BO keeps its own preferred and allowed domains, it no longer makes sure the BO is in GTT. A user fence in a VRAM BO, which only needs to be a page in size, gets its address from amdgpu_bo_gpu_offset(), which warns about non-contiguous VRAM. On navi31, a CS with a user fence in a 4K VRAM BO, or in one created with AMDGPU_GEM_CREATE_VM_ALWAYS_VALID:
WARNING: amdgpu_object.c:1531 at amdgpu_bo_gpu_offset+0x86/0xb0 [amdgpu], CPU#11: cs_gem_checks/18393 RIP: 0010:amdgpu_bo_gpu_offset+0x86/0xb0 [amdgpu] Call Trace: <TASK> amdgpu_cs_parser_bos.isra.0+0x4eb/0x850 [amdgpu] amdgpu_cs_ioctl+0x97e/0x2510 [amdgpu] drm_ioctl_kernel+0xac/0x110 [drm] drm_ioctl+0x2c6/0x5b0 [drm] __x64_sys_ioctl+0xa0/0xf0 do_syscall_64+0xa3/0x4d0 entry_SYSCALL_64_after_hwframe+0x76/0x7e
and BOs which can't be in GTT at all, like GWS or OA ones of a page in size, pass the checks as well.
Only take BOs which can't be anywhere else than in GTT as user fence, which the CS then validates there along with its other BOs. While at it, detect userptrs with amdgpu_ttm_tt_is_userptr(); amdgpu_ttm_tt_get_usermm() returns NULL once the task which created the userptr is gone.
v2: only take BOs which can only be in GTT instead of special casing the
user fence BO in the validation, use amdgpu_ttm_tt_is_userptr() (Christian)
(cherry picked from commit f16989def9561d04d0f2e77216f5319112d29bf1)
The Linux kernel CVE team has assigned CVE-2026-99633 to this issue.
Affected and fixed versions
===========================
Fixed in 6.12.118 with commit b4a1229ab05f0ba7fa1a52032686e32e801fcc04 Fixed in 6.18.64 with commit 69a46cbe11b6eb15f6d48591a67217ac634ddc3d Fixed in 7.3.5 with commit 2c7bd4568f5d19d63241ccdf930b15e619af7c2b Fixed in 7.4-rc2 with commit 7a56d929dc2304edaa6231e1eb5eb82b7e8b74a9
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-99633
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/b4a1229ab05f0ba7fa1a52032686e32e801fcc04 https://git.kernel.org/stable/c/69a46cbe11b6eb15f6d48591a67217ac634ddc3d https://git.kernel.org/stable/c/2c7bd4568f5d19d63241ccdf930b15e619af7c2b https://git.kernel.org/stable/c/7a56d929dc2304edaa6231e1eb5eb82b7e8b74a9