Cyber Posture

CVE-2025-21751

High

Published: 27 February 2025

Published
27 February 2025
Modified
19 September 2025
KEV Added
Patch
CVSS Score 7.8 CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS Score 0.0002 4.2th percentile
Risk Priority 16 60% EPSS · 20% KEV · 20% CVSS

Summary

CVE-2025-21751 is a high-severity Use After Free (CWE-416) vulnerability in Linux Linux Kernel. Its CVSS base score is 7.8 (High).

Operationally, exploitation aligns with the MITRE ATT&CK technique Exploitation for Privilege Escalation (T1068); ranked at the 4.2th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog.

The strongest mitigations our analysis identified are NIST 800-53 SI-2 (Flaw Remediation) and SI-11 (Error Handling).

Threat & Defense at a Glance

What attackers do: exploitation maps to Exploitation for Privilege Escalation (T1068) and 1 other technique. What defenders deploy: see the NIST 800-53 controls recommended below.
Threat & Defense Details

Mitigating Controls (NIST 800-53 r5)AI

prevent

Directly mitigates the use-after-free vulnerability by requiring timely remediation through application of the specific kernel patches fixing mlx5 HWS matcher disconnect error handling.

prevent

Addresses the root cause of improper error handling during firmware failure in matcher disconnect, preventing conditions that lead to use-after-free.

prevent

Provides memory protection mechanisms that mitigate exploitation of the use-after-free in the mlx5 driver by safeguarding against unauthorized memory access.

MITRE ATT&CK Enterprise TechniquesAI

T1068 Exploitation for Privilege Escalation Privilege Escalation
Adversaries may exploit software vulnerabilities in an attempt to elevate privileges.
T1499.004 Application or System Exploitation Impact
Adversaries may exploit software vulnerabilities that can cause an application or system to crash and deny availability to users.
Why these techniques?

Local kernel use-after-free in mlx5 driver enables arbitrary code execution for privilege escalation (T1068) by low-privileged attackers and system crashes via exploitation (T1499.004).

Confidence: HIGH · MITRE ATT&CK Enterprise v18.1

NVD Description

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…

more

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.

Deeper analysisAI

CVE-2025-21751 is a use-after-free vulnerability (CWE-416) in the Linux kernel's mlx5 network driver, specifically within the Hardware Steering (HWS) component. The issue arises during the matcher disconnect flow when a firmware failure occurs: the existing error handling reconnects the matcher and returns an error, allowing the calling function to proceed and free the matcher while it remains listed, leading to a use-after-free condition and system crash. The vulnerability carries a CVSS v3.1 base score of 7.8 (AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H) and was published on 2025-02-27.

A local attacker with low privileges can exploit this vulnerability due to its low attack complexity and lack of user interaction requirements. Successful exploitation could result in high impacts to confidentiality, integrity, and availability, potentially enabling arbitrary code execution, data corruption, or system crashes via the use-after-free in the mlx5 driver's matcher handling.

The provided patch references from kernel.org stable repositories (commits 1ce840c7a659aa53a31ef49f0271b4fd0dc10296, 23a86c76a1a197e8fbbbd0ce3e826eb58c471624, and 5682aad0276ff9b9b0eff3188eb6a1f504d6b436) mitigate the issue by modifying the error flow in the mlx5 HWS matcher disconnect function. Instead of attempting to reconnect the matcher on firmware command failure, the updated code avoids reconnection, preventing the use-after-free and crash at the cost of potential bad steering state or resource leakage, as firmware errors cannot be fully resolved during resource destruction.

Details

CWE(s)

Affected Products

linux
linux kernel
≤ 6.13.3

CVEs Like This One

CVE-2024-57795Same product: Linux Linux Kernel
CVE-2026-31665Same product: Linux Linux Kernel
CVE-2025-21791Same product: Linux Linux Kernel
CVE-2024-57951Same product: Linux Linux Kernel
CVE-2025-21883Same product: Linux Linux Kernel
CVE-2026-31485Same product: Linux Linux Kernel
CVE-2026-31511Same product: Linux Linux Kernel
CVE-2023-53023Same product: Linux Linux Kernel
CVE-2026-31580Same product: Linux Linux Kernel
CVE-2024-58072Same product: Linux Linux Kernel

References