# CVE-2025-38109: net/mlx5: Fix ECVF vports unload on shutdown flow

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

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; 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.28% (percentile 13, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2025-07-03T08:35:19.240Z
- **Modified:** 2026-06-17T09:16:04.400Z

## Who should check

- Anyone running Linux \>= a7719b29a82199b90ebbf355d3332e0fbfbf6045, \< 5953ae44dfe5dbad374318875be834c3b7b71ee6; \>= a7719b29a82199b90ebbf355d3332e0fbfbf6045, \< da15ca0553325acf68039015f2f4db750c8e2b96; \>= a7719b29a82199b90ebbf355d3332e0fbfbf6045, \< 24db585d369f949f698e03d7d8017e5ae19d0497; \>= a7719b29a82199b90ebbf355d3332e0fbfbf6045, \< 687560d8a9a2d654829ad0da1ec24242f1de711d
- Anyone running Linux 6.5

## Description

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

net/mlx5: Fix ECVF vports unload on shutdown flow

Fix shutdown flow UAF when a virtual function is created on the embedded
chip (ECVF) of a BlueField device. In such case the vport acl ingress
table is not properly destroyed.

ECVF functionality is independent of ecpf\_vport\_exists capability and
thus functions mlx5\_eswitch\_(enable\|disable)\_pf\_vf\_vports() should not
test it when enabling/disabling ECVF vports.

kernel log:
\[\] refcount\_t: underflow; use-after-free.
\[\] WARNING: CPU: 3 PID: 1 at lib/refcount.c:28
   refcount\_warn\_saturate+0x124/0x220
----------------
\[\] Call trace:
\[\] refcount\_warn\_saturate+0x124/0x220
\[\] tree\_put\_node+0x164/0x1e0 \[mlx5\_core\]
\[\] mlx5\_destroy\_flow\_table+0x98/0x2c0 \[mlx5\_core\]
\[\] esw\_acl\_ingress\_table\_destroy+0x28/0x40 \[mlx5\_core\]
\[\] esw\_acl\_ingress\_lgcy\_cleanup+0x80/0xf4 \[mlx5\_core\]
\[\] esw\_legacy\_vport\_acl\_cleanup+0x44/0x60 \[mlx5\_core\]
\[\] esw\_vport\_cleanup+0x64/0x90 \[mlx5\_core\]
\[\] mlx5\_esw\_vport\_disable+0xc0/0x1d0 \[mlx5\_core\]
\[\] mlx5\_eswitch\_unload\_ec\_vf\_vports+0xcc/0x150 \[mlx5\_core\]
\[\] mlx5\_eswitch\_disable\_sriov+0x198/0x2a0 \[mlx5\_core\]
\[\] mlx5\_device\_disable\_sriov+0xb8/0x1e0 \[mlx5\_core\]
\[\] mlx5\_sriov\_detach+0x40/0x50 \[mlx5\_core\]
\[\] mlx5\_unload+0x40/0xc4 \[mlx5\_core\]
\[\] mlx5\_unload\_one\_devl\_locked+0x6c/0xe4 \[mlx5\_core\]
\[\] mlx5\_unload\_one+0x3c/0x60 \[mlx5\_core\]
\[\] shutdown+0x7c/0xa4 \[mlx5\_core\]
\[\] pci\_device\_shutdown+0x3c/0xa0
\[\] device\_shutdown+0x170/0x340
\[\] \_\_do\_sys\_reboot+0x1f4/0x2a0
\[\] \_\_arm64\_sys\_reboot+0x2c/0x40
\[\] invoke\_syscall+0x78/0x100
\[\] el0\_svc\_common.constprop.0+0x54/0x184
\[\] do\_el0\_svc+0x30/0xac
\[\] el0\_svc+0x48/0x160
\[\] el0t\_64\_sync\_handler+0xa4/0x12c
\[\] el0t\_64\_sync+0x1a4/0x1a8
\[\] --\[ end trace 9c4601d68c70030e \]---

## Affected and fixed versions

- Linux: \>= a7719b29a82199b90ebbf355d3332e0fbfbf6045, \< 5953ae44dfe5dbad374318875be834c3b7b71ee6; \>= a7719b29a82199b90ebbf355d3332e0fbfbf6045, \< da15ca0553325acf68039015f2f4db750c8e2b96; \>= a7719b29a82199b90ebbf355d3332e0fbfbf6045, \< 24db585d369f949f698e03d7d8017e5ae19d0497; \>= a7719b29a82199b90ebbf355d3332e0fbfbf6045, \< 687560d8a9a2d654829ad0da1ec24242f1de711d (cvelist)
- Linux: 6.5 (cvelist)

## Mitigation

- Upgrade Linux to 687560d8a9a2d654829ad0da1ec24242f1de711d or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2025-38109.md
Affected: Linux >= a7719b29a82199b90ebbf355d3332e0fbfbf6045, < 5953ae44dfe5dbad374318875be834c3b7b71ee6; >= a7719b29a82199b90ebbf355d3332e0fbfbf6045, < da15ca0553325acf68039015f2f4db750c8e2b96; >= a7719b29a82199b90ebbf355d3332e0fbfbf6045, < 24db585d369f949f698e03d7d8017e5ae19d0497; >= a7719b29a82199b90ebbf35…
Fixed in: Linux 5953ae44dfe5dbad374318875be834c3b7b71ee6, Linux 24db585d369f949f698e03d7d8017e5ae19d0497, Linux 687560d8a9a2d654829ad0da1ec24242f1de711d

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-2025-38109 being exploited?

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

### How serious is CVE-2025-38109?

High: CVSS 7.8 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-38109?

Linux \>= a7719b29a82199b90ebbf355d3332e0fbfbf6045, \< 5953ae44dfe5dbad374318875be834c3b7b71ee6; \>= a7719b29a82199b90ebbf355d3332e0fbfbf6045, \< da15ca0553325acf68039015f2f4db750c8e2b96; \>= a7719b29a82199b90ebbf355d3332e0fbfbf6045, \< 24db585d369f949f698e03d7d8017e5ae19d0497; \>= a7719b29a82199b90ebbf355d3332e0fbfbf6045, \< 687560d8a9a2d654829ad0da1ec24242f1de711d; Linux 6.5.

### Is there a fix for CVE-2025-38109?

Yes. Fixed in Linux 5953ae44dfe5dbad374318875be834c3b7b71ee6, Linux 24db585d369f949f698e03d7d8017e5ae19d0497, Linux 687560d8a9a2d654829ad0da1ec24242f1de711d. Upgrade Linux to 687560d8a9a2d654829ad0da1ec24242f1de711d or later.

### How do I check if I'm affected by CVE-2025-38109?

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/5953ae44dfe5dbad374318875be834c3b7b71ee6>
- patch: <https://git.kernel.org/stable/c/da15ca0553325acf68039015f2f4db750c8e2b96>
- patch: <https://git.kernel.org/stable/c/24db585d369f949f698e03d7d8017e5ae19d0497>
- patch: <https://git.kernel.org/stable/c/687560d8a9a2d654829ad0da1ec24242f1de711d>

## 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-2025-38109>

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