CVE-2025-38141

Source
https://nvd.nist.gov/vuln/detail/CVE-2025-38141
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-38141.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2025-38141
Downstream
Published
2025-07-03T08:35:42Z
Modified
2025-10-10T12:04:37.790307Z
Summary
dm: fix dm_blk_report_zones
Details

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

dm: fix dmblkreport_zones

If dmgetlivetable() returned NULL, dmputlivetable() was never called. Also, it is possible that md->zonerevalidatemap will change while calling this function. Only read it once, so that we are always using the same value. Otherwise we might miss a call to dmputlive_table().

Finally, while md->zonerevalidatemap is set and a process is calling blkrevalidatediskzones() to set up the zone append emulation resources, it is possible that another process, perhaps triggered by blkdevreportzonesioctl(), will call dmblkreportzones(). If blkrevalidatediskzones() fails, these resources can be freed while the other process is still using them, causing a use-after-free error.

blkrevalidatediskzones() will only ever be called when initially setting up the zone append emulation resources, such as when setting up a zoned dm-crypt table for the first time. Further table swaps will not set md->zonerevalidatemap or call blkrevalidatediskzones(). However it must be called using the new table (referenced by md->zonerevalidatemap) and the new queue limits while the DM device is suspended. dmblkreportzones() needs some way to distinguish between a call from blkrevalidatediskzones(), which must be allowed to use md->zonerevalidatemap to access this not yet activated table, and all other calls to dmblkreportzones(), which should not be allowed while the device is suspended and cannot use md->zonerevalidatemap, since the zone resources might be freed by the process currently calling blkrevalidatediskzones().

Solve this by tracking the process that sets md->zonerevalidatemap in dmrevalidatezones() and only allowing that process to make use of it in dmblkreport_zones().

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
f211268ed1f9bdf48f06a3ead5f5d88437450579
Fixed
f9c1bdf24615303d48a2d0fd629c88f3189563aa
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
f211268ed1f9bdf48f06a3ead5f5d88437450579
Fixed
d19bc1b4dd5f322980b1f05f79b2ea4f0db10920
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
f211268ed1f9bdf48f06a3ead5f5d88437450579
Fixed
37f53a2c60d03743e0eacf7a0c01c279776fef4e

Affected versions

v6.*

v6.10
v6.10-rc1
v6.10-rc2
v6.10-rc3
v6.10-rc4
v6.10-rc5
v6.10-rc6
v6.10-rc7
v6.11
v6.11-rc1
v6.11-rc2
v6.11-rc3
v6.11-rc4
v6.11-rc5
v6.11-rc6
v6.11-rc7
v6.12
v6.12-rc1
v6.12-rc2
v6.12-rc3
v6.12-rc4
v6.12-rc5
v6.12-rc6
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.4
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.9
v6.9-rc3
v6.9-rc4
v6.9-rc5
v6.9-rc6
v6.9-rc7

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.10.0
Fixed
6.12.34
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.15.3