KernelScan.io

HIGH Introduced in 6.5

amdkfd DebugTrap RefcountLeak

CVE-2026-98910

CVSS 7.8 / 10.0 KernelScan AI

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

01

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.

02

Engine v0.9.0

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.

Affecteddrivers/gpu/drm/amd/amdkfd/kfd_debug.c (amdkfd)

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.

03

BranchIntroducedFixed inPatch commit
6.126.56.12.111656a40bdc20d
6.186.56.18.531b39f46eec2f
6.66.56.6.158641be20110cd
mainline6.57.201112e241e37
cip/6.126.56.12.111-cip32656a40bdc20d

04

State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.

CIP treeState
cip/6.12Fixed in 6.12.111-cip32