CVE-2025-38209

Source
https://cve.org/CVERecord?id=CVE-2025-38209
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-38209.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2025-38209
Downstream
Related
Published
2025-07-04T13:37:28.853Z
Modified
2026-03-23T05:04:27.417182301Z
Summary
nvme-tcp: remove tag set when second admin queue config fails
Details

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

nvme-tcp: remove tag set when second admin queue config fails

Commit 104d0e2f6222 ("nvme-fabrics: reset admin connection for secure concatenation") modified nvmetcpsetupctrl() to call nvmetcpconfigureadminqueue() twice. The first call prepares for DH-CHAP negotitation, and the second call is required for secure concatenation. However, this change triggered BUG KASAN slab-use-after- free in blkmqqueuetagbusyiter(). This BUG can be recreated by repeating the blktests test case nvme/063 a few times [1].

When the BUG happens, nvmetcpcreate_ctrl() fails in the call chain below:

nvmetcpcreatectrl() nvmetcpallocctrl() new=true ... Alloc nvmetcpctrl and admintagset nvmetcpsetupctrl() new=true nvmetcpconfigureadminqueue() new=true ... Succeed nvmeallocadmintagset() ... Alloc the tag set for admintagset nvmestopkeepalive() nvmetcpteardownadminqueue() remove=false nvmetcpconfigureadminqueue() new=false nvmetcpallocadminqueue() ... Fail, but do not call nvmeremoveadmintagset() nvmeuninitctrl() nvmeputctrl() ... Free up the nvmetcpctrl and admintagset

The first call of nvmetcpconfigureadminqueue() succeeds with new=true argument. The second call fails with new=false argument. This second call does not call nvmeremoveadmintagset() on failure, due to the new=false argument. Then the admin tag set is not removed. However, nvmetcpcreatectrl() assumes that nvmetcpsetupctrl() would call nvmeremoveadmintagset(). Then it frees up struct nvmetcpctrl which has admintagset field. Later on, the timeout handler accesses the admintagset field and causes the BUG KASAN slab-use-after-free.

To not leave the admin tag set, call nvmeremoveadmintagset() when the second nvmetcpconfigureadminqueue() call fails. Do not return from nvmetcpsetupctrl() on failure. Instead, jump to "destroyadmin" go-to label to call nvmetcpteardownadminqueue() which calls nvmeremoveadmintagset().

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/38xxx/CVE-2025-38209.json"
}
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
104d0e2f622233477ef7e57e59e8a4c3bb062c82
Fixed
db1da838b6012e4570c6f81e28ffe1d0ff595948
Fixed
e7143706702a209c814ed2c3fc6486c2a7decf6c

Affected versions

v6.*
v6.14
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

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-38209.json"