CVE-2025-38520

5.5 MEDIUM

📋 TL;DR

A race condition in the Linux kernel's AMD GPU driver (amdkfd) can cause a deadlock when a process exits while memory management operations are in progress. This vulnerability affects Linux systems with AMD GPUs using the amdgpu driver, potentially causing system hangs and VRAM memory leaks.

💻 Affected Systems

Products:
  • Linux kernel with AMD GPU driver (amdgpu)
Versions: Linux kernel versions containing the vulnerable amdkfd code before the fix commit a29e067bd38946f752b0ef855f3dfff87e77bec7
Operating Systems: Linux distributions with affected kernel versions
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects systems with AMD GPUs using the amdgpu driver. Requires the amdkfd kernel module to be loaded (typically when using AMD GPU compute features).

📦 What is this software?

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

⚠️ Risk & Real-World Impact

🔴

Worst Case

System becomes unresponsive (deadlock) requiring hard reboot, with persistent VRAM memory leaks that could degrade GPU performance over time.

🟠

Likely Case

Occasional system hangs during memory-intensive operations or process termination, with gradual VRAM memory leaks affecting GPU-accelerated applications.

🟢

If Mitigated

Minor performance impact during memory management operations with no system instability.

🌐 Internet-Facing: LOW - This is a local kernel vulnerability requiring local access or compromised local process.
🏢 Internal Only: MEDIUM - Could be exploited by malicious local users or through compromised applications to cause denial of service.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires triggering specific race conditions during process exit while memory operations are active. Likely requires local access or ability to run malicious code.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Linux kernel with commit a29e067bd38946f752b0ef855f3dfff87e77bec7 or later

Vendor Advisory: https://git.kernel.org/stable/c/145a56bd68f4bff098d59fbc7c263d20dfef4fc4

Restart Required: Yes

Instructions:

1. Update Linux kernel to version containing the fix commit. 2. For distributions: Use package manager (apt/yum/dnf) to update kernel package. 3. Reboot system to load patched kernel.

🔧 Temporary Workarounds

Disable AMD KFD module

Linux

Prevent loading of the vulnerable amdkfd kernel module if AMD GPU compute features are not required.

echo 'blacklist amdkfd' >> /etc/modprobe.d/blacklist-amdkfd.conf
update-initramfs -u
reboot

🧯 If You Can't Patch

  • Monitor system for hung tasks and memory leaks, restart affected services if detected
  • Limit GPU memory allocation to trusted users/processes only

🔍 How to Verify

Check if Vulnerable:

Check if amdkfd module is loaded: lsmod | grep amdkfd. If loaded and kernel version predates fix commit, system is vulnerable.

Check Version:

uname -r

Verify Fix Applied:

Verify kernel version includes fix commit: git log --oneline | grep 'a29e067bd38946f752b0ef855f3dfff87e77bec7' or check kernel changelog.

📡 Detection & Monitoring

Log Indicators:

  • Kernel logs showing hung tasks related to python/amdgpu processes
  • System logs showing processes stuck in 'D' (uninterruptible sleep) state
  • dmesg output showing memory management errors

Network Indicators:

  • None - this is a local kernel vulnerability

SIEM Query:

Process:State='D' AND Process:Name CONTAINS 'python' AND Process:CommandLine CONTAINS 'amdgpu'

🔗 References

📤 Share & Export