CVE-2025-38628

Source
https://nvd.nist.gov/vuln/detail/CVE-2025-38628
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-38628.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2025-38628
Downstream
Related
Published
2025-08-22T16:00:36Z
Modified
2025-10-22T15:21:03.104337Z
Summary
vdpa/mlx5: Fix release of uninitialized resources on error path
Details

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 mlx5vdpafree() is the single entrypoint for removing the vdpa device resources added in mlx5vdpadevadd(), even in the cleanup path of mlx5vdpadevadd().

This means that all functions from mlx5vdpafree() should be able to handle uninitialized resources. This was not the case though: mlx5vdpadestroymrresources() and mlx5cmdcleanupasyncctx() 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 mlx5vdpadestroymrresources() return early if called on uninitialized resources.

  • Moves mlx5cmdinitasyncctx() early on during device addition because it can't fail. This means that mlx5cmdcleanupasyncctx() also can't fail. To mirror this, move the call site of mlx5cmdcleanupasyncctx() in mlx5vdpafree().

An additional comment was added in mlx5vdpafree() to document the expectations of functions called from this context.

Splat:

mlx5core 0000:b5:03.2: mlx5vdpadevadd:3950:(pid 2306) warning: No mac address provisioned? ------------[ cut here ]------------ WARNING: CPU: 13 PID: 2306 at kernel/workqueue.c:4207 flushwork+0x9a/0xb0 [...] Call Trace: <TASK> ? _trytodeltimersync+0x61/0x90 ? _timerdeletesync+0x2b/0x40 mlx5vdpadestroymrresources+0x1c/0x40 [mlx5vdpa] mlx5vdpafree+0x45/0x160 [mlx5vdpa] vdpareleasedev+0x1e/0x50 [vdpa] devicerelease+0x31/0x90 kobjectcleanup+0x37/0x130 mlx5vdpadevadd+0x327/0x890 [mlx5vdpa] vdpanlcmddevaddsetdoit+0x2c1/0x4d0 [vdpa] genlfamilyrcvmsgdoit+0xd8/0x130 genlfamilyrcvmsg+0x14b/0x220 ? _pfxvdpanlcmddevaddsetdoit+0x10/0x10 [vdpa] genlrcvmsg+0x47/0xa0 ? _pfxgenlrcvmsg+0x10/0x10 netlinkrcvskb+0x53/0x100 genlrcv+0x24/0x40 netlinkunicast+0x27b/0x3b0 netlinksendmsg+0x1f7/0x430 _syssendto+0x1fa/0x210 ? _pteoffsetmap+0x17/0x160 ? nextuptodatefolio+0x85/0x2b0 ? percpucounteraddbatch+0x51/0x90 ? filemapmappages+0x515/0x660 _x64syssendto+0x20/0x30 dosyscall64+0x7b/0x2c0 ? doreadfault+0x108/0x220 ? doptemissing+0x14a/0x3e0 ? _handlemmfault+0x321/0x730 ? countmemcgevents+0x13f/0x180 ? handlemmfault+0x1fb/0x2d0 ? douseraddrfault+0x20c/0x700 ? syscallexitwork+0x104/0x140 entrySYSCALL64after_hwframe+0x76/0x7e RIP: 0033:0x7f0c25b0feca [...] ---[ end trace 0000000000000000 ]---

References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
83e445e64f48bdae3f25013e788fcf592f142576
Fixed
37f26b9013b46457b0a96633fc3a7dc977d8beb1
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
83e445e64f48bdae3f25013e788fcf592f142576
Fixed
cf4fc23d0d3d5b89b36f0d79f2674510bb574d8e
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
83e445e64f48bdae3f25013e788fcf592f142576
Fixed
6de4ef950dd56a6a81daf92d8a1d864fc6a56971
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
83e445e64f48bdae3f25013e788fcf592f142576
Fixed
cc51a66815999afb7e9cd845968de4fdf07567b7

Affected versions

v6.*

v6.12
v6.12-rc7
v6.12.1
v6.12.10
v6.12.11
v6.12.12
v6.12.13
v6.12.14
v6.12.15
v6.12.16
v6.12.17
v6.12.18
v6.12.19
v6.12.2
v6.12.20
v6.12.21
v6.12.22
v6.12.23
v6.12.24
v6.12.25
v6.12.26
v6.12.27
v6.12.28
v6.12.29
v6.12.3
v6.12.30
v6.12.31
v6.12.32
v6.12.33
v6.12.34
v6.12.35
v6.12.36
v6.12.37
v6.12.38
v6.12.39
v6.12.4
v6.12.40
v6.12.41
v6.12.5
v6.12.6
v6.12.7
v6.12.8
v6.12.9
v6.13
v6.13-rc1
v6.13-rc2
v6.13-rc3
v6.13-rc4
v6.13-rc5
v6.13-rc6
v6.13-rc7
v6.14
v6.14-rc1
v6.14-rc2
v6.14-rc3
v6.14-rc4
v6.14-rc5
v6.14-rc6
v6.14-rc7
v6.15
v6.15-rc1
v6.15-rc2
v6.15-rc3
v6.15-rc4
v6.15-rc5
v6.15-rc6
v6.15-rc7
v6.15.1
v6.15.2
v6.15.3
v6.15.4
v6.15.5
v6.15.6
v6.15.7
v6.15.8
v6.15.9
v6.16
v6.16-rc1
v6.16-rc2
v6.16-rc3
v6.16-rc4
v6.16-rc5
v6.16-rc6
v6.16-rc7

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.12.0
Fixed
6.12.42
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.15.10
Type
ECOSYSTEM
Events
Introduced
6.16.0
Fixed
6.16.1