CVE-2025-68366

Source
https://cve.org/CVERecord?id=CVE-2025-68366
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-68366.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2025-68366
Downstream
Related
Published
2025-12-24T10:32:53.399Z
Modified
2026-03-20T12:46:23.384234Z
Summary
nbd: defer config unlock in nbd_genl_connect
Details

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

nbd: defer config unlock in nbdgenlconnect

There is one use-after-free warning when running NBDCMDCONNECT and NBDCLEARSOCK:

nbdgenlconnect nbdallocandinitconfig // configrefs=1 nbdstartdevice // configrefs=2 set NBDRTHASCONFIGREF open nbd // configrefs=3 recvwork done // configrefs=2 NBDCLEARSOCK // configrefs=1 close nbd // configrefs=0 refcountinc -> uaf

------------[ cut here ]------------ refcountt: addition on 0; use-after-free. WARNING: CPU: 24 PID: 1014 at lib/refcount.c:25 refcountwarnsaturate+0x12e/0x290 nbdgenlconnect+0x16d0/0x1ab0 genlfamilyrcvmsgdoit+0x1f3/0x310 genlrcv_msg+0x44a/0x790

The issue can be easily reproduced by adding a small delay before refcountinc(&nbd->configrefs) in nbdgenlconnect():

    mutex_unlock(&nbd->config_lock);
    if (!ret) {
            set_bit(NBD_RT_HAS_CONFIG_REF, &config->runtime_flags);

+ printk("before sleep\n"); + mdelay(5 * 1000); + printk("after sleep\n"); refcountinc(&nbd->configrefs); nbdconnectreply(info, nbd->index); }

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/68xxx/CVE-2025-68366.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
e46c7287b1c27683a8e30ca825fb98e2b97f1099
Fixed
330d688a5ca53857828081a3cf31b92ad1b0b3ed
Fixed
cd93db1b1b4460e6ee77564024ea461e5940f69c
Fixed
ae3e7bc1f4b393ae20e5c85583eb2c6977374716
Fixed
2e5e0665a594f076ef2b9439447bae8be293d09d
Fixed
c9b99c948b4fb014812afe7b5ccf2db121d22e46
Fixed
9a38306643874566d20f7aba7dff9e6f657b51a9
Fixed
c9e805f6a35d1dd189a9345595a5c20e87611942
Fixed
1649714b930f9ea6233ce0810ba885999da3b5d4

Database specific

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

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
4.12.0
Fixed
5.10.248
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.198
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.1.160
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.6.120
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.12.63
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.17.13
Type
ECOSYSTEM
Events
Introduced
6.18.0
Fixed
6.18.2

Database specific

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