CVE-2024-40906

7.8 HIGH

📋 TL;DR

A use-after-free vulnerability in the Linux kernel's mlx5 network driver allows local attackers to cause a kernel panic (denial of service) or potentially execute arbitrary code. The vulnerability occurs during driver removal when the health timer continues running after resources have been freed. This affects systems using Mellanox network adapters with the mlx5 driver.

💻 Affected Systems

Products:
  • Linux kernel mlx5 network driver
Versions: Linux kernel versions before the fix commits (specific versions vary by distribution)
Operating Systems: Linux distributions using vulnerable kernel versions
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects systems with Mellanox network adapters using the mlx5 driver module loaded.

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

⚠️ Risk & Real-World Impact

🔴

Worst Case

Local privilege escalation to kernel-level code execution leading to complete system compromise.

🟠

Likely Case

Kernel panic causing system crash and denial of service, requiring physical or remote console access to reboot.

🟢

If Mitigated

System remains stable with proper patching; no impact if vulnerable driver isn't loaded.

🌐 Internet-Facing: LOW - Requires local access to trigger; not remotely exploitable.
🏢 Internal Only: MEDIUM - Local users or processes could crash critical systems using mlx5 drivers.

🎯 Exploit Status

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

Requires local access and ability to trigger driver removal (e.g., via module unloading or system shutdown).

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Linux kernel with commits 6ccada6ffb42e0ac75e3db06d41baf5a7f483f8a or later

Vendor Advisory: https://git.kernel.org/stable/c/6ccada6ffb42e0ac75e3db06d41baf5a7f483f8a

Restart Required: Yes

Instructions:

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

🔧 Temporary Workarounds

Prevent mlx5 module loading

linux

Blacklist mlx5_core module if Mellanox adapters aren't required

echo 'blacklist mlx5_core' >> /etc/modprobe.d/blacklist-mlx5.conf
update-initramfs -u

🧯 If You Can't Patch

  • Avoid unloading mlx5 driver modules while system is operational
  • Restrict local user access to systems with vulnerable mlx5 drivers

🔍 How to Verify

Check if Vulnerable:

Check if mlx5_core module is loaded: lsmod | grep mlx5_core. If loaded, check kernel version against patched versions.

Check Version:

uname -r

Verify Fix Applied:

Verify kernel version includes fix commit: grep -q '6ccada6ffb42e0ac75e3db06d41baf5a7f483f8a' /boot/config-$(uname -r) 2>/dev/null && echo 'Patched' || echo 'Check kernel source'

📡 Detection & Monitoring

Log Indicators:

  • Kernel Oops messages mentioning mlx5_core and page faults
  • System crash/panic logs during driver teardown

Network Indicators:

  • Sudden loss of network connectivity on Mellanox interfaces

SIEM Query:

event_source:kernel AND (message:"mlx5_core" AND ("page fault" OR "Oops" OR "UAF"))

🔗 References

📤 Share & Export