{"id":"CVE-2025-68366","summary":"nbd: defer config unlock in nbd_genl_connect","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nnbd: defer config unlock in nbd_genl_connect\n\nThere is one use-after-free warning when running NBD_CMD_CONNECT and\nNBD_CLEAR_SOCK:\n\nnbd_genl_connect\n  nbd_alloc_and_init_config // config_refs=1\n  nbd_start_device // config_refs=2\n  set NBD_RT_HAS_CONFIG_REF\t\t\topen nbd // config_refs=3\n  recv_work done // config_refs=2\n\t\t\t\t\t\tNBD_CLEAR_SOCK // config_refs=1\n\t\t\t\t\t\tclose nbd // config_refs=0\n  refcount_inc -\u003e uaf\n\n------------[ cut here ]------------\nrefcount_t: addition on 0; use-after-free.\nWARNING: CPU: 24 PID: 1014 at lib/refcount.c:25 refcount_warn_saturate+0x12e/0x290\n nbd_genl_connect+0x16d0/0x1ab0\n genl_family_rcv_msg_doit+0x1f3/0x310\n genl_rcv_msg+0x44a/0x790\n\nThe issue can be easily reproduced by adding a small delay before\nrefcount_inc(&nbd-\u003econfig_refs) in nbd_genl_connect():\n\n        mutex_unlock(&nbd-\u003econfig_lock);\n        if (!ret) {\n                set_bit(NBD_RT_HAS_CONFIG_REF, &config-\u003eruntime_flags);\n+               printk(\"before sleep\\n\");\n+               mdelay(5 * 1000);\n+               printk(\"after sleep\\n\");\n                refcount_inc(&nbd-\u003econfig_refs);\n                nbd_connect_reply(info, nbd-\u003eindex);\n        }","modified":"2026-03-31T17:30:05.470042Z","published":"2025-12-24T10:32:53.399Z","related":["SUSE-SU-2026:0447-1","SUSE-SU-2026:0472-1","SUSE-SU-2026:0473-1","SUSE-SU-2026:0587-1","SUSE-SU-2026:20477-1","SUSE-SU-2026:20498-1","SUSE-SU-2026:20555-1","SUSE-SU-2026:20599-1","SUSE-SU-2026:20615-1","SUSE-SU-2026:20845-1","SUSE-SU-2026:20876-1","openSUSE-SU-2026:10039-1","openSUSE-SU-2026:10301-1","openSUSE-SU-2026:20287-1"],"database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/68xxx/CVE-2025-68366.json","cna_assigner":"Linux"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/1649714b930f9ea6233ce0810ba885999da3b5d4"},{"type":"WEB","url":"https://git.kernel.org/stable/c/2e5e0665a594f076ef2b9439447bae8be293d09d"},{"type":"WEB","url":"https://git.kernel.org/stable/c/330d688a5ca53857828081a3cf31b92ad1b0b3ed"},{"type":"WEB","url":"https://git.kernel.org/stable/c/9a38306643874566d20f7aba7dff9e6f657b51a9"},{"type":"WEB","url":"https://git.kernel.org/stable/c/ae3e7bc1f4b393ae20e5c85583eb2c6977374716"},{"type":"WEB","url":"https://git.kernel.org/stable/c/c9b99c948b4fb014812afe7b5ccf2db121d22e46"},{"type":"WEB","url":"https://git.kernel.org/stable/c/c9e805f6a35d1dd189a9345595a5c20e87611942"},{"type":"WEB","url":"https://git.kernel.org/stable/c/cd93db1b1b4460e6ee77564024ea461e5940f69c"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/68xxx/CVE-2025-68366.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-68366"},{"type":"PACKAGE","url":"https://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"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"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"}}],"schema_version":"1.7.5"}