CVE-2025-40251
📋 TL;DR
A Linux kernel vulnerability in the devlink rate subsystem leaves dangling parent pointers when destroying rate objects, causing memory corruption and potential kernel crashes. This affects systems using devlink rate objects with specific drivers like netdevsim and mlx5. The issue can be triggered during device removal or driver unloading operations.
💻 Affected Systems
- Linux kernel
📦 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 →⚠️ Risk & Real-World Impact
Worst Case
Kernel panic or system crash due to memory corruption, leading to denial of service and potential data loss.
Likely Case
Kernel warning messages and memory leaks when removing devices or unloading drivers, potentially causing system instability.
If Mitigated
Minor performance impact or warning messages in logs without system compromise.
🎯 Exploit Status
Exploitation requires privileged access to configure devlink rate objects and trigger device removal. The vulnerability is triggered through normal administrative operations rather than malicious payloads.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Kernel versions with commits: 542f45486f1c, 715d9cda646a, c70df6c17d38, f94c1a114ac2
Vendor Advisory: https://git.kernel.org/stable/c/542f45486f1ce2d2dde75bd85aca0389ef7046c3
Restart Required: Yes
Instructions:
1. Update Linux kernel to version containing the fix commits. 2. Reboot system to load new kernel. 3. Verify fix by checking kernel version and testing devlink operations.
🔧 Temporary Workarounds
Avoid devlink rate operations
linuxDo not configure devlink rate objects or parent relationships on affected drivers.
# Avoid commands like:
# devlink port function rate add
# devlink port function rate set ... parent ...
Prevent driver unloading
linuxAvoid unloading affected drivers (mlx5_core, netdevsim) while devlink rate objects are configured.
# Do not run:
# modprobe -r mlx5_core
# echo 1 > /sys/bus/netdevsim/del_device
🧯 If You Can't Patch
- Restrict access to devlink configuration to trusted administrators only
- Monitor system logs for refcount warnings and investigate any occurrences
🔍 How to Verify
Check if Vulnerable:
Check if kernel logs contain refcount warnings during devlink rate operations or driver unloading. Test with repro steps from CVE description.
Check Version:
uname -r
Verify Fix Applied:
After patching, perform the repro steps from CVE description and verify no refcount warnings appear in dmesg.
📡 Detection & Monitoring
Log Indicators:
- refcount_t: decrement hit 0; leaking memory
- WARNING: CPU: ... at lib/refcount.c:31 refcount_warn_saturate
- devl_rate_leaf_destroy+0x8d/0x90 in stack traces
Network Indicators:
- None - local kernel vulnerability
SIEM Query:
source="kernel" AND ("refcount_t" OR "devl_rate") AND ("WARNING" OR "leaking memory")
🔗 References
- https://git.kernel.org/stable/c/542f45486f1ce2d2dde75bd85aca0389ef7046c3
- https://git.kernel.org/stable/c/715d9cda646a8a38ea8b2bb5afb679a7464055e2
- https://git.kernel.org/stable/c/90e51e20bcec9bff5b2421ce1bd95704764655f5
- https://git.kernel.org/stable/c/c70df6c17d389cc743f0eb30160e2d6bc6910db8
- https://git.kernel.org/stable/c/f94c1a114ac209977bdf5ca841b98424295ab1f0