HIGH Introduced in 6.5
amdkfd DebugTrap RefcountLeak
CVE-2026-98910
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: drm/amdkfd: Unwind debug trap enable on copy_to_user failure If kfd_dbg_trap_enable() fails while copying runtime_info to userspace, it had already activated the trap, set debug_trap_enabled, taken an extra process reference, and opened the debug event file. Return -EFAULT without unwinding that state, leaving inconsistent trap state and a refcount imbalance that could break later DISABLE/ENABLE. On copy_to_user failure, deactivate the trap and undo the rest of the enable setup before returning.
02KernelScan AI Analysis
Risk summary
Local users with access to an AMD GPU device can trigger a refcount leak and debug trap state inconsistency by forcing a copy_to_user failure during debug trap enable. This can lead to use-after-free, memory corruption, and kernel privilege escalation or denial of service.
Vulnerability analysis
When enabling a debug trap on an AMD GPU process via the KFD ioctl, the kernel activates the trap, takes an extra process reference, opens a debug event file, and marks the trap as enabled before copying runtime information to userspace. If that copy fails — for example, because the caller passes an invalid userspace pointer — the original code returned an error without reversing any of those steps. This leaves the trap active, the process reference leaked, the file descriptor open, and the enabled flag set, creating an inconsistent state that breaks subsequent disable/enable operations and can cause a use-after-free when the process reference count becomes corrupted. The fix adds the missing cleanup in the error path: it deactivates the trap, closes the event file, decrements the debugger's process count, clears the enabled flag, and drops the extra process reference before returning -EFAULT. The vulnerability is reachable by any local user who can open the AMD KFD device (typically members of the render group) and issue the debug trap enable ioctl with a malformed userspace pointer.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.12 | 6.5 | 6.12.111 | 656a40bdc20d |
| 6.18 | 6.5 | 6.18.53 | 1b39f46eec2f |
| 6.6 | 6.5 | 6.6.158 | 641be20110cd |
| mainline | 6.5 | 7.2 | 01112e241e37 |
| cip/6.12 | 6.5 | 6.12.111-cip32 | 656a40bdc20d |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.111-cip32 |