CVE-2025-21751·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: net/mlx5: HWS, change error flow on matcher disconnect Currently, when firmware failure occurs during matcher disconnect flow, the error flow of the function reconnects the matcher back and returns an error, which continues running the calling function and eventually frees the matcher that is being disconnected. This leads to a case where we have a freed matcher on the matchers list, which in turn leads to use-after-free and eventual crash. This patch fixes that by not trying to reconnect the matcher back when some FW command fails during disconnect. Note that we're dealing here with FW error. We can't overcome this problem. This might lead to bad steering state (e.g. wrong connection between matchers), and will also lead to resource leakage, as it is the case with any other error handling during resource destruction. However, the goal here is to allow the driver to continue and not crash the machine with use-after-free error.
- Severity
- high
- Software
- Kernel
- Fixed in
- 6.13.3
- Published
- 2025-02-27
Affected versions
Until: 6.13.3
Fixed in: 6.13.3
How to fix this CVE
Update your Linux kernel to version 6.13.3 or later to resolve a use-after-free vulnerability in the Mellanox HWS (Hardware Steering) matcher disconnect logic. This vulnerability occurs when firmware errors during matcher disconnection cause improper state management, potentially leading to kernel crashes. Apply the kernel update immediately, particularly if you are running Mellanox ConnectX network adapters.
sudo dnf update kernel kernel-develDefensia detects this vulnerability
How to check if you are affected
- Step 1: Check your installed kernel version with 'uname -r' and compare against the fixed version 6.13.3
- Step 2: Verify if Mellanox MLX5 network drivers are loaded using 'lsmod | grep mlx5'
- Step 3: Search kernel logs for use-after-free errors or matcher-related crashes with 'dmesg | grep -i "mlx5\|use-after-free\|matcher"'
- Step 4: After patching, reboot the system and confirm the new kernel version with 'uname -r' to verify the fix is active
FAQ
What is CVE-2025-21751?
This is a use-after-free vulnerability in the Linux kernel's Mellanox HWS (Hardware Steering) driver that occurs when firmware errors prevent proper matcher disconnection, leaving freed memory references on the active matcher list and potentially causing kernel crashes.
Is CVE-2025-21751 being actively exploited?
No, this vulnerability is not listed on the CISA Known Exploited Vulnerabilities (KEV) catalog and no public exploits are currently available.
What versions of Kernel are affected by CVE-2025-21751?
Kernel versions prior to 6.13.3 are affected. The exact range of vulnerable versions is not fully documented, but 6.13.3 and later contain the fix.
How do I check if my server is vulnerable to CVE-2025-21751?
Run 'uname -r' to check your kernel version. If it is earlier than 6.13.3, and you have Mellanox MLX5 adapters (check with 'lsmod | grep mlx5'), your system is potentially vulnerable.
Does Defensia detect CVE-2025-21751?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Kernel is installed on a monitored server, CVE-2025-21751 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2025-21751. Free for 1 server.
Get started free