# CVE-2022-48858: net/mlx5: Fix a race on command flush flow

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.0
- **CVSS:** 7.0 (v3.1, CNA) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: High; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.22% (percentile 8, 2026-11-26)
- **CWE:** CWE-362, CWE-416
- **Published:** 2024-07-16T12:25:23.123Z
- **Modified:** 2026-08-05T08:52:39.770Z

## Who should check

- Anyone running Linux \>= 073fff8102062cd675170ceb54d90da22fe7e668, \< 1a4017926eeea56c7540cc41b42106746ee8a0ee; \>= 50b2412b7e7862c5af0cbf4b10d93bc5c712d021, \< f3331bc17449f15832c31823f27573f4c0e13e5f; \>= 50b2412b7e7862c5af0cbf4b10d93bc5c712d021, \< 7c519f769f555ff7d9d4ccba3497bbb589df360a; \>= 50b2412b7e7862c5af0cbf4b10d93bc5c712d021, \< 0401bfb27a91d7bdd74b1635c1aae57cbb128da6; \>= 50b2412b7e7862c5af0cbf4b10d93bc5c712d021, \< 063bd355595428750803d8736a9bb7c8db67d42d; da87ea137373689dec9d3fafa34a57787320a4b3; \>= 5.4.71, \< 5.4.185; \>= 5.8.15, \< 5.9
- Anyone running Linux 5.9

## Description

In the Linux kernel, the following vulnerability has been resolved:

net/mlx5: Fix a race on command flush flow

Fix a refcount use after free warning due to a race on command entry.
Such race occurs when one of the commands releases its last refcount and
frees its index and entry while another process running command flush
flow takes refcount to this command entry. The process which handles
commands flush may see this command as needed to be flushed if the other
process released its refcount but didn't release the index yet. Fix it
by adding the needed spin lock.

It fixes the following warning trace:

refcount\_t: addition on 0; use-after-free.
WARNING: CPU: 11 PID: 540311 at lib/refcount.c:25 refcount\_warn\_saturate+0x80/0xe0
...
RIP: 0010:refcount\_warn\_saturate+0x80/0xe0
...
Call Trace:
 \<TASK\>
 mlx5\_cmd\_trigger\_completions+0x293/0x340 \[mlx5\_core\]
 mlx5\_cmd\_flush+0x3a/0xf0 \[mlx5\_core\]
 enter\_error\_state+0x44/0x80 \[mlx5\_core\]
 mlx5\_fw\_fatal\_reporter\_err\_work+0x37/0xe0 \[mlx5\_core\]
 process\_one\_work+0x1be/0x390
 worker\_thread+0x4d/0x3d0
 ? rescuer\_thread+0x350/0x350
 kthread+0x141/0x160
 ? set\_kthread\_struct+0x40/0x40
 ret\_from\_fork+0x1f/0x30
 \</TASK\>

## Affected and fixed versions

- Linux: \>= 073fff8102062cd675170ceb54d90da22fe7e668, \< 1a4017926eeea56c7540cc41b42106746ee8a0ee; \>= 50b2412b7e7862c5af0cbf4b10d93bc5c712d021, \< f3331bc17449f15832c31823f27573f4c0e13e5f; \>= 50b2412b7e7862c5af0cbf4b10d93bc5c712d021, \< 7c519f769f555ff7d9d4ccba3497bbb589df360a; \>= 50b2412b7e7862c5af0cbf4b10d93bc5c712d021, \< 0401bfb27a91d7bdd74b1635c1aae57cbb128da6; \>= 50b2412b7e7862c5af0cbf4b10d93bc5c712d021, \< 063bd355595428750803d8736a9bb7c8db67d42d; da87ea137373689dec9d3fafa34a57787320a4b3; \>= 5.4.71, \< 5.4.185; \>= 5.8.15, \< 5.9 (cvelist)
- Linux: 5.9 (cvelist)

## Mitigation

- Upgrade Linux to 5.9 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-48858. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-48858.md
Affected: Linux >= 073fff8102062cd675170ceb54d90da22fe7e668, < 1a4017926eeea56c7540cc41b42106746ee8a0ee; >= 50b2412b7e7862c5af0cbf4b10d93bc5c712d021, < f3331bc17449f15832c31823f27573f4c0e13e5f; >= 50b2412b7e7862c5af0cbf4b10d93bc5c712d021, < 7c519f769f555ff7d9d4ccba3497bbb589df360a; >= 50b2412b7e7862c5af0cbf4…
Fixed in: Linux 1a4017926eeea56c7540cc41b42106746ee8a0ee, Linux 7c519f769f555ff7d9d4ccba3497bbb589df360a, Linux 0401bfb27a91d7bdd74b1635c1aae57cbb128da6, Linux 063bd355595428750803d8736a9bb7c8db67d42d, Linux 5.4.185, Linux 5.9

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2022-48858 being exploited?

There is no confirmed exploitation: CVE-2022-48858 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.22% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2022-48858?

High: CVSS 7.0 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed). The attack needs conditions outside the attacker's control, which makes it harder.

### Which versions are affected by CVE-2022-48858?

Linux \>= 073fff8102062cd675170ceb54d90da22fe7e668, \< 1a4017926eeea56c7540cc41b42106746ee8a0ee; \>= 50b2412b7e7862c5af0cbf4b10d93bc5c712d021, \< f3331bc17449f15832c31823f27573f4c0e13e5f; \>= 50b2412b7e7862c5af0cbf4b10d93bc5c712d021, \< 7c519f769f555ff7d9d4ccba3497bbb589df360a; \>= 50b2412b7e7862c5af0cbf4b10d93bc5c712d021, \< 0401bfb27a91d7bdd74b1635c1aae57cbb128da6; \>= 50b2412b7e7862c5af0cbf4b10d93bc5c712d021, \< 063bd355595428750803d8736a9bb7c8db67d42d; da87ea137373689dec9d3fafa34a57787320a4b3; \>= 5.4.71, \< 5.4.185; \>= 5.8.15, \< 5.9; Linux 5.9.

### Is there a fix for CVE-2022-48858?

Yes. Fixed in Linux 1a4017926eeea56c7540cc41b42106746ee8a0ee, Linux 7c519f769f555ff7d9d4ccba3497bbb589df360a, Linux 0401bfb27a91d7bdd74b1635c1aae57cbb128da6, Linux 063bd355595428750803d8736a9bb7c8db67d42d, Linux 5.4.185, Linux 5.9. Upgrade Linux to 5.9 or later.

### How do I check if I'm affected by CVE-2022-48858?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/1a4017926eeea56c7540cc41b42106746ee8a0ee>
- patch: <https://git.kernel.org/stable/c/f3331bc17449f15832c31823f27573f4c0e13e5f>
- patch: <https://git.kernel.org/stable/c/7c519f769f555ff7d9d4ccba3497bbb589df360a>
- patch: <https://git.kernel.org/stable/c/0401bfb27a91d7bdd74b1635c1aae57cbb128da6>
- patch: <https://git.kernel.org/stable/c/063bd355595428750803d8736a9bb7c8db67d42d>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-48858>

HTML: <https://flawdb.com/CVE-2022-48858> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-48858>
