CVE-2025-38161

5.5 MEDIUM

📋 TL;DR

This CVE describes a use-after-free vulnerability in the Linux kernel's RDMA (Remote Direct Memory Access) subsystem, specifically in the mlx5 driver for Mellanox network adapters. When firmware commands fail during RQ (Receive Queue) destruction, improper cleanup leads to kernel memory corruption that can cause system crashes or potential privilege escalation. Systems using RDMA with affected mlx5 drivers are vulnerable.

💻 Affected Systems

Products:
  • Linux kernel with mlx5 RDMA driver
Versions: Linux kernel versions containing the vulnerable code (specific versions not provided in CVE, but patches available for stable branches)
Operating Systems: Linux distributions using affected kernel versions
Default Config Vulnerable: ⚠️ Yes
Notes: Requires RDMA functionality with mlx5 driver enabled; typical in HPC, cloud, and storage environments using Mellanox hardware.

📦 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 →

⚠️ Risk & Real-World Impact

🔴

Worst Case

Kernel panic leading to system crash, potential privilege escalation to kernel mode, or system instability requiring reboot.

🟠

Likely Case

System crash or kernel panic when RDMA operations fail, requiring system reboot and causing service disruption.

🟢

If Mitigated

System remains stable with proper patching; unpatched systems may experience crashes during RDMA operations.

🌐 Internet-Facing: LOW - Requires local access or RDMA network access; not directly exploitable over standard internet protocols.
🏢 Internal Only: MEDIUM - Affects systems using RDMA for high-performance computing, storage, or networking; requires local or RDMA network access.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: HIGH - Requires triggering specific firmware failure conditions during RDMA operations.

Exploitation requires triggering firmware command failures during RQ destruction; may be difficult to reliably trigger.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Patches available in Linux kernel stable branches (commits referenced in CVE)

Vendor Advisory: https://git.kernel.org/stable/c/0a7790cbba654e925243571cf2f24d61603d3ed3

Restart Required: Yes

Instructions:

1. Update Linux kernel to patched version. 2. For distributions: Use package manager (yum update kernel / apt-get upgrade linux-image). 3. Reboot system to load new kernel.

🔧 Temporary Workarounds

Disable RDMA mlx5 driver

linux

Prevent loading of vulnerable mlx5 RDMA driver module

echo 'blacklist mlx5_ib' >> /etc/modprobe.d/blacklist.conf
rmmod mlx5_ib

Disable RDMA functionality

linux

Disable RDMA subsystem if not required

echo 'blacklist rdma_ucm' >> /etc/modprobe.d/blacklist.conf
rmmod rdma_ucm rdma_cm ib_core

🧯 If You Can't Patch

  • Restrict RDMA access to trusted users and systems only
  • Monitor system logs for kernel panic or refcount warnings related to mlx5

🔍 How to Verify

Check if Vulnerable:

Check if mlx5_ib module is loaded: lsmod | grep mlx5_ib

Check Version:

uname -r

Verify Fix Applied:

Check kernel version after update matches patched version; verify no refcount warnings in dmesg

📡 Detection & Monitoring

Log Indicators:

  • Kernel logs showing 'refcount_t: underflow; use-after-free'
  • WARNING messages mentioning mlx5_core_put_rsc
  • System crash/panic logs

Network Indicators:

  • Unusual RDMA connection failures

SIEM Query:

source="kernel" AND ("refcount_t: underflow" OR "mlx5_core_put_rsc" OR "use-after-free")

🔗 References

📤 Share & Export