CVE-2024-40906
📋 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
- Linux kernel mlx5 network driver
📦 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.
🎯 Exploit Status
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
linuxBlacklist 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
- https://git.kernel.org/stable/c/6ccada6ffb42e0ac75e3db06d41baf5a7f483f8a
- https://git.kernel.org/stable/c/c8b3f38d2dae0397944814d691a419c451f9906f
- https://git.kernel.org/stable/c/e6777ae0bf6fd5bc626bb051c8c93e3c8198a3f8
- https://git.kernel.org/stable/c/e7d4485d47839f4d1284592ae242c4e65b2810a9
- https://git.kernel.org/stable/c/6ccada6ffb42e0ac75e3db06d41baf5a7f483f8a
- https://git.kernel.org/stable/c/c8b3f38d2dae0397944814d691a419c451f9906f
- https://git.kernel.org/stable/c/e6777ae0bf6fd5bc626bb051c8c93e3c8198a3f8
- https://git.kernel.org/stable/c/e7d4485d47839f4d1284592ae242c4e65b2810a9
- https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html