# CVE-2025-21751: net/mlx5: HWS, change error flow on matcher disconnect

- Severity: High 7.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.25%, higher than 17% of CVEs (2026-12-01)
- Published: 2025-02-27T02:12:22.177Z
- Modified: 2026-08-05T11:54:07.723Z
- Weaknesses: CWE-416
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: Linux

## 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 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.

(As written by CVE List.)

## Affected

- Linux Linux: from 472dd792348f6601ccaa97d5626ee4faff891901 before 5682aad0276ff9b9b0eff3188eb6a1f504d6b436; from 472dd792348f6601ccaa97d5626ee4faff891901 before 23a86c76a1a197e8fbbbd0ce3e826eb58c471624; from 472dd792348f6601ccaa97d5626ee4faff891901 before 1ce840c7a659aa53a31ef49f0271b4fd0dc10296; 6.12 (not affected: before 6.12; from 6.12.48 up to 6.12.*; from 6.13.3 up to 6.13.*; from 6.14 up to *)
- linux linux_kernel: before 6.13.3

## Every score

- Linux: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- CISA-ADP: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://git.kernel.org/stable/c/5682aad0276ff9b9b0eff3188eb6a1f504d6b436>
- <https://git.kernel.org/stable/c/23a86c76a1a197e8fbbbd0ce3e826eb58c471624> (patch)
- <https://git.kernel.org/stable/c/1ce840c7a659aa53a31ef49f0271b4fd0dc10296> (patch)

## Sources

- CVE List: [CVE-2025-21751](https://www.cve.org/CVERecord?id=CVE-2025-21751), CVE Terms of Use, modified 2026-08-05
- NVD: [CVE-2025-21751](https://nvd.nist.gov/vuln/detail/CVE-2025-21751), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2025-21751 · Whole record: https://cve.day/CVE-2025-21751.json · Rebuilt by cve.day 2026-11-25T22:58:54.529Z
