Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-98166 Overview
CVE-2026-98166 is a use-after-free vulnerability in the Linux kernel's Direct Rendering Manager Translation Table Manager (drm/ttm) subsystem. The flaw lives in ttm_bo_swapout_cb(), where a prior fix for an infinite LRU walk inadvertently gated bulk_move bookkeeping on if (!ret). Because ttm_tt_swapout() returns the page count on success, the removal path never executes, and swapped-out resources remain inside their buffer object's bulk_move range. When the resource is later freed, range cursors in pos->first and pos->last point to released memory, producing a use-after-free in subsequent ttm_lru_bulk_move_tail() or ttm_resource_add_bulk_move() calls.
Critical Impact
Local attackers or unprivileged workloads that trigger memory pressure, hibernation, or process exit can cause kernel memory corruption, crashes, and potential privilege escalation on affected AMD GPU systems.
Affected Products
- Linux kernel versions carrying commit b2ed01e7ad3d ("drm/ttm: Fix ttm_bo_swapout() infinite LRU walk on swapout failure")
- Linux stable 7.0.y series (observed on Ubuntu 7.0.0-31)
- Systems using the drm/ttm subsystem, notably AMD GPU drivers (amdgpu)
Discovery Timeline
- 2026-10-06 - CVE-2026-98166 published to NVD
- 2026-10-07 - Last updated in NVD database
Technical Details for CVE-2026-98166
Vulnerability Analysis
The drm/ttm subsystem manages buffer objects (BOs) for GPU memory. Each BO can belong to a bulk_move range that tracks LRU ordering for groups of related resources. When memory pressure forces a swapout, ttm_bo_swapout_cb() must remove the resource from its bulk_move range before marking it unevictable.
Commit b2ed01e7ad3d restructured this logic to prevent infinite LRU walks on swapout failure. The commit placed the ttm_resource_del_bulk_move_unevictable() and ttm_resource_move_to_lru_tail() calls under an if (!ret) guard. This condition is never true on success because ttm_tt_swapout() returns the number of pages swapped out, which is always positive for a populated TTM.
As a result, every successful swapout skips bulk_move removal. The swapped-out resource stays inside the BO's bulk_move range despite being unevictable. When the resource is later freed through ttm_resource_free() or the BO leaves the bulk_move via ttm_bo_set_bulk_move() (for example during amdgpu_vm_bo_del()), ttm_resource_del_bulk_move() short-circuits on its !ttm_resource_unevictable() guard. The range endpoints retain pointers to freed memory.
Root Cause
The root cause is an incorrect success check. The parallel shrinker fix in commit 1d59f36e95f7 correctly tests lret > 0, which is the intended condition. The swapout path tests !ret, which treats success as failure and skips the required cleanup.
Attack Vector
Exploitation requires local code execution that triggers GPU memory pressure or hibernation cycles. Symptoms include a reservation WARN in ttm_lru_bulk_move_add(), list_del corruption in ttm_resource_move_to_lru_tail(), or NULL dereference in ttm_resource_manager_next(). The window spans minutes to hours after hibernation, or appears at process exit and reboot. A controlled trigger could allow a local attacker to corrupt kernel memory and escalate privileges.
See the Linux Kernel Commit 1169fe8c and Linux Kernel Commit 3db7d7d5 for the exact source changes.
Detection Methods for CVE-2026-98166
Indicators of Compromise
- Kernel warnings referencing ttm_lru_bulk_move_add() reservation (resv) checks
- list_del corruption messages originating from ttm_resource_move_to_lru_tail()
- NULL pointer dereference oops traces inside ttm_resource_manager_next()
- Unexplained kernel panics occurring minutes to hours after suspend-then-hibernate, process exit, or reboot on AMD GPU systems
Detection Strategies
- Function profiling of hibernation cycles that shows many ttm_tt_swapout() calls with zero ttm_resource_del_bulk_move_unevictable() calls
- Static analysis of running kernels to confirm whether the patched return-code check (lret > 0) is present in ttm_bo_swapout_cb()
- Correlating hibernation events with kernel ring buffer entries containing ttm_ symbols
Monitoring Recommendations
- Centralize dmesg and journald kernel logs from Linux endpoints and alert on BUG:, WARN:, and list_del corruption entries referencing TTM symbols
- Track hibernation and resume events on AMD GPU hosts and correlate with subsequent kernel instability
- Inventory running kernel versions to identify hosts carrying commit b2ed01e7ad3d without the fix
How to Mitigate CVE-2026-98166
Immediate Actions Required
- Apply the upstream fix referenced in Linux Kernel Commit 1169fe8c and Linux Kernel Commit 3db7d7d5
- Update to a distribution kernel package that includes the corrected lret > 0 success check in ttm_bo_swapout_cb()
- Reboot affected systems after patching to activate the fixed kernel
Patch Information
The fix changes the success check in ttm_bo_swapout_cb() so that ttm_resource_del_bulk_move_unevictable() and ttm_resource_move_to_lru_tail() execute whenever ttm_tt_swapout() returns a positive value. The patch is available in the stable kernel tree through the two commits listed above. Distribution vendors shipping the backport of b2ed01e7ad3d should import the corresponding fix into their stable branches.
Workarounds
- Disable suspend-then-hibernate and standard hibernation on affected AMD GPU hosts until the kernel is patched
- Reduce GPU memory pressure by lowering workload concurrency, which decreases the frequency of TTM swapout events
- Where feasible, boot a kernel that predates commit b2ed01e7ad3d to avoid the regressed code path
# Disable hibernation targets on systemd-based distributions
sudo systemctl mask hibernate.target suspend-then-hibernate.target hybrid-sleep.target
# Verify the running kernel version against patched stable releases
uname -r
# Confirm the fix is present in the running kernel source (if available)
grep -n "lret > 0" /usr/src/linux/drivers/gpu/drm/ttm/ttm_bo.c
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

