# CVE-2025-38628: vdpa/mlx5: Fix release of uninitialized resources on error path

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

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; 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.26% (percentile 11, 2026-11-26)
- **CWE:** CWE-908
- **Published:** 2025-08-22T16:00:36.841Z
- **Modified:** 2026-06-17T09:17:14.850Z

## Who should check

- Anyone running Linux \>= 83e445e64f48bdae3f25013e788fcf592f142576, \< 37f26b9013b46457b0a96633fc3a7dc977d8beb1; \>= 83e445e64f48bdae3f25013e788fcf592f142576, \< cf4fc23d0d3d5b89b36f0d79f2674510bb574d8e; \>= 83e445e64f48bdae3f25013e788fcf592f142576, \< 6de4ef950dd56a6a81daf92d8a1d864fc6a56971; \>= 83e445e64f48bdae3f25013e788fcf592f142576, \< cc51a66815999afb7e9cd845968de4fdf07567b7
- Anyone running Linux 6.12

## Description

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

vdpa/mlx5: Fix release of uninitialized resources on error path

The commit in the fixes tag made sure that mlx5\_vdpa\_free()
is the single entrypoint for removing the vdpa device resources
added in mlx5\_vdpa\_dev\_add(), even in the cleanup path of
mlx5\_vdpa\_dev\_add().

This means that all functions from mlx5\_vdpa\_free() should be able to
handle uninitialized resources. This was not the case though:
mlx5\_vdpa\_destroy\_mr\_resources() and mlx5\_cmd\_cleanup\_async\_ctx()
were not able to do so. This caused the splat below when adding
a vdpa device without a MAC address.

This patch fixes these remaining issues:

- Makes mlx5\_vdpa\_destroy\_mr\_resources() return early if called on
  uninitialized resources.

- Moves mlx5\_cmd\_init\_async\_ctx() early on during device addition
  because it can't fail. This means that mlx5\_cmd\_cleanup\_async\_ctx()
  also can't fail. To mirror this, move the call site of
  mlx5\_cmd\_cleanup\_async\_ctx() in mlx5\_vdpa\_free().

An additional comment was added in mlx5\_vdpa\_free() to document
the expectations of functions called from this context.

Splat:

  mlx5\_core 0000:b5:03.2: mlx5\_vdpa\_dev\_add:3950:(pid 2306) warning: No mac address provisioned?
  ------------\[ cut here \]------------
  WARNING: CPU: 13 PID: 2306 at kernel/workqueue.c:4207 \_\_flush\_work+0x9a/0xb0
  \[...\]
  Call Trace:
   \<TASK\>
   ? \_\_try\_to\_del\_timer\_sync+0x61/0x90
   ? \_\_timer\_delete\_sync+0x2b/0x40
   mlx5\_vdpa\_destroy\_mr\_resources+0x1c/0x40 \[mlx5\_vdpa\]
   mlx5\_vdpa\_free+0x45/0x160 \[mlx5\_vdpa\]
   vdpa\_release\_dev+0x1e/0x50 \[vdpa\]
   device\_release+0x31/0x90
   kobject\_cleanup+0x37/0x130
   mlx5\_vdpa\_dev\_add+0x327/0x890 \[mlx5\_vdpa\]
   vdpa\_nl\_cmd\_dev\_add\_set\_doit+0x2c1/0x4d0 \[vdpa\]
   genl\_family\_rcv\_msg\_doit+0xd8/0x130
   genl\_family\_rcv\_msg+0x14b/0x220
   ? \_\_pfx\_vdpa\_nl\_cmd\_dev\_add\_set\_doit+0x10/0x10 \[vdpa\]
   genl\_rcv\_msg+0x47/0xa0
   ? \_\_pfx\_genl\_rcv\_msg+0x10/0x10
   netlink\_rcv\_skb+0x53/0x100
   genl\_rcv+0x24/0x40
   netlink\_unicast+0x27b/0x3b0
   netlink\_sendmsg+0x1f7/0x430
   \_\_sys\_sendto+0x1fa/0x210
   ? \_\_\_pte\_offset\_map+0x17/0x160
   ? next\_uptodate\_folio+0x85/0x2b0
   ? percpu\_counter\_add\_batch+0x51/0x90
   ? filemap\_map\_pages+0x515/0x660
   \_\_x64\_sys\_sendto+0x20/0x30
   do\_syscall\_64+0x7b/0x2c0
   ? do\_read\_fault+0x108/0x220
   ? do\_pte\_missing+0x14a/0x3e0
   ? \_\_handle\_mm\_fault+0x321/0x730
   ? count\_memcg\_events+0x13f/0x180
   ? handle\_mm\_fault+0x1fb/0x2d0
   ? do\_user\_addr\_fault+0x20c/0x700
   ? syscall\_exit\_work+0x104/0x140
   entry\_SYSCALL\_64\_after\_hwframe+0x76/0x7e
  RIP: 0033:0x7f0c25b0feca
  \[...\]
  ---\[ end trace 0000000000000000 \]---

## Affected and fixed versions

- Linux: \>= 83e445e64f48bdae3f25013e788fcf592f142576, \< 37f26b9013b46457b0a96633fc3a7dc977d8beb1; \>= 83e445e64f48bdae3f25013e788fcf592f142576, \< cf4fc23d0d3d5b89b36f0d79f2674510bb574d8e; \>= 83e445e64f48bdae3f25013e788fcf592f142576, \< 6de4ef950dd56a6a81daf92d8a1d864fc6a56971; \>= 83e445e64f48bdae3f25013e788fcf592f142576, \< cc51a66815999afb7e9cd845968de4fdf07567b7 (cvelist)
- Linux: 6.12 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2025-38628.md
Affected: Linux >= 83e445e64f48bdae3f25013e788fcf592f142576, < 37f26b9013b46457b0a96633fc3a7dc977d8beb1; >= 83e445e64f48bdae3f25013e788fcf592f142576, < cf4fc23d0d3d5b89b36f0d79f2674510bb574d8e; >= 83e445e64f48bdae3f25013e788fcf592f142576, < 6de4ef950dd56a6a81daf92d8a1d864fc6a56971; >= 83e445e64f48bdae3f25013…
Fixed in: Linux 37f26b9013b46457b0a96633fc3a7dc977d8beb1, Linux 6de4ef950dd56a6a81daf92d8a1d864fc6a56971

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-38628 being exploited?

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

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

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

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

Linux \>= 83e445e64f48bdae3f25013e788fcf592f142576, \< 37f26b9013b46457b0a96633fc3a7dc977d8beb1; \>= 83e445e64f48bdae3f25013e788fcf592f142576, \< cf4fc23d0d3d5b89b36f0d79f2674510bb574d8e; \>= 83e445e64f48bdae3f25013e788fcf592f142576, \< 6de4ef950dd56a6a81daf92d8a1d864fc6a56971; \>= 83e445e64f48bdae3f25013e788fcf592f142576, \< cc51a66815999afb7e9cd845968de4fdf07567b7; Linux 6.12.

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

Yes. Fixed in Linux 37f26b9013b46457b0a96633fc3a7dc977d8beb1, Linux 6de4ef950dd56a6a81daf92d8a1d864fc6a56971. No fix listed yet: follow the vendor advisory.

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

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/37f26b9013b46457b0a96633fc3a7dc977d8beb1>
- patch: <https://git.kernel.org/stable/c/cf4fc23d0d3d5b89b36f0d79f2674510bb574d8e>
- patch: <https://git.kernel.org/stable/c/6de4ef950dd56a6a81daf92d8a1d864fc6a56971>
- patch: <https://git.kernel.org/stable/c/cc51a66815999afb7e9cd845968de4fdf07567b7>

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

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