{"api_version":"1","generated_at":"2026-09-18T05:26:02+00:00","cve":"CVE-2026-90171","urls":{"html":"https://cve.report/CVE-2026-90171","api":"https://cve.report/api/cve/CVE-2026-90171.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-90171","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-90171"},"summary":{"title":"smb: smbdirect: release pending child sockets outside the handler lock","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nsmb: smbdirect: release pending child sockets outside the handler lock\n\nsmbdirect_socket_destroy() releases the listener's pending/ready child\nsockets while still holding the listener's handler lock, the\n&id_priv->handler_mutex taken via rdma_lock_handler(), not\nsc->listen.lock, and before the listener's own rdma_destroy_id().\nThat ordering has one real consequence and one cosmetic one.\n\nThe real one: smbdirect_socket_release() drops the child's last\nreference, which destroys the child's cm_id.  Doing that before the\nlistener's rdma_destroy_id() lets _cma_cancel_listens(), running from\nthe listener's _destroy_id(), walk an already freed child id_priv,\nwhich KASAN catches as a slab-use-after-free during listener shutdown:\n\n[ 4758.909130] BUG: KASAN: slab-use-after-free in __mutex_lock+0x1469/0x1560\n[ 4758.911450] Read of size 1 at addr ffff88821c381db4 by task ksmbd.control/1652\n[ 4758.913262] Call Trace:\n[ 4758.913267]  <TASK>\n[ 4758.913299]  __mutex_lock+0x1469/0x1560\n[ 4758.913408]  _cma_cancel_listens+0x312/0x3b0\n[ 4758.913413]  _destroy_id+0x363/0xee0\n[ 4758.913417]  smbdirect_socket_destroy_sync+0x17d5/0x2440\n[ 4758.913443]  smbdirect_socket_release+0x124/0x230\n[ 4758.913451]  ksmbd_rdma_stop_listening+0x9f/0x190\n[ 4758.913457]  ksmbd_conn_transport_destroy+0x65/0x3c0\n[ 4758.913463]  kill_server_store+0x1fb/0x2b0\n[ 4758.913501]  kernfs_fop_write_iter+0x349/0x4d0\n[ 4758.913507]  vfs_write+0x5e7/0xc70\n[ 4758.913528]  ksys_write+0x12a/0x210\n[ 4758.913541]  do_syscall_64+0x135/0x460\n[ 4758.913555]  entry_SYSCALL_64_after_hwframe+0x77/0x7f\n\nThe cosmetic one: releasing a child recurses into\nsmbdirect_socket_destroy(), which takes the child's own\nrdma_lock_handler() lock nested under the listener's.  The listener's\nand the child's cm_id are always different instances, so this cannot\ndeadlock for real; the CM core itself nests a new connection id's\nhandler_mutex under the listening id's in cma_ib_req_handler().  But\nlockdep only sees one lock class, reports possible recursive locking,\nand then disables itself, hiding real locking bugs for the rest of the\nrun:\n\n[ 2424.579653] WARNING: possible recursive locking detected\n[ 2424.581180] 7.1.0-next-20260623+ #89 Not tainted\n[ 2424.582548] --------------------------------------------\n[ 2424.584500] ksmbd.control/8854 is trying to acquire lock:\n[ 2424.586817] ffff888102303c20 (&id_priv->handler_mutex){+.+.}-{4:4}, at: smbdirect_socket_destroy_sync+0xc39/0x2440\n[ 2424.590590]\n[ 2424.590590] but task is already holding lock:\n[ 2424.591601] ffff888102046c20 (&id_priv->handler_mutex){+.+.}-{4:4}, at: smbdirect_socket_destroy_sync+0xc39/0x2440\n[ 2424.594178]\n[ 2424.594178] other info that might help us debug this:\n[ 2424.596634]  Possible unsafe locking scenario:\n[ 2424.596634]\n[ 2424.598841]        CPU0\n[ 2424.599765]        ----\n[ 2424.600695]   lock(&id_priv->handler_mutex);\n[ 2424.601836]   lock(&id_priv->handler_mutex);\n[ 2424.602590]\n[ 2424.602590]  *** DEADLOCK ***\n[ 2424.602590]\n[ 2424.604512]  May be due to missing lock nesting notation\n\nSplice the pending/ready children onto a local list under the\nlistener's listen.lock, while the handler lock is held so a concurrent\nCM CONNECT_REQUEST cannot add more, but defer the actual\nsmbdirect_socket_release() calls until after the listener's cm_id has\nbeen destroyed and its handler lock dropped.  The children are\nindependent sockets whose teardown needs neither the listener's\nhandler lock nor its cm_id.\n\nFound with ksmbdzzer [2], a KSMBD fuzzer that drives libFuzzer with a\nkcov-dataflow [1] coverage vector: it folds each instrumented\ncomparison/argument's runtime operand value together with its PC (the\ndefault arm mixes them as pc⊕val) so that a new operand value at a known\nsite counts as new coverage.\n\n[1] https://lwn.net/Articles/1077606/\n[2] https://github.com/yskzalloc/kcov-dataflow","state":"PUBLISHED","assigner":"Linux","published_at":"2026-09-17 17:17:10","updated_at":"2026-09-17 17:17:10"},"problem_types":[],"metrics":[],"references":[{"url":"https://git.kernel.org/stable/c/db82fbe4bb68e68e4aef00ef5b79f92991d8ef8e","name":"https://git.kernel.org/stable/c/db82fbe4bb68e68e4aef00ef5b79f92991d8ef8e","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/8ea83ef0c40ec4463695e22bc9ae43e29bcfede7","name":"https://git.kernel.org/stable/c/8ea83ef0c40ec4463695e22bc9ae43e29bcfede7","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-90171","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-90171","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected dc691b91ad1677def14582a279e56fd943b52f94 8ea83ef0c40ec4463695e22bc9ae43e29bcfede7 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected dc691b91ad1677def14582a279e56fd943b52f94 db82fbe4bb68e68e4aef00ef5b79f92991d8ef8e git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 7.1","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.1 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.2.6 7.2.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.3-rc1 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["fs/smb/smbdirect/socket.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"8ea83ef0c40ec4463695e22bc9ae43e29bcfede7","status":"affected","version":"dc691b91ad1677def14582a279e56fd943b52f94","versionType":"git"},{"lessThan":"db82fbe4bb68e68e4aef00ef5b79f92991d8ef8e","status":"affected","version":"dc691b91ad1677def14582a279e56fd943b52f94","versionType":"git"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["fs/smb/smbdirect/socket.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"7.1"},{"lessThan":"7.1","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"7.2.*","status":"unaffected","version":"7.2.6","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.3-rc1","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.2.6","versionStartIncluding":"7.1","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.3-rc1","versionStartIncluding":"7.1","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nsmb: smbdirect: release pending child sockets outside the handler lock\n\nsmbdirect_socket_destroy() releases the listener's pending/ready child\nsockets while still holding the listener's handler lock, the\n&id_priv->handler_mutex taken via rdma_lock_handler(), not\nsc->listen.lock, and before the listener's own rdma_destroy_id().\nThat ordering has one real consequence and one cosmetic one.\n\nThe real one: smbdirect_socket_release() drops the child's last\nreference, which destroys the child's cm_id.  Doing that before the\nlistener's rdma_destroy_id() lets _cma_cancel_listens(), running from\nthe listener's _destroy_id(), walk an already freed child id_priv,\nwhich KASAN catches as a slab-use-after-free during listener shutdown:\n\n[ 4758.909130] BUG: KASAN: slab-use-after-free in __mutex_lock+0x1469/0x1560\n[ 4758.911450] Read of size 1 at addr ffff88821c381db4 by task ksmbd.control/1652\n[ 4758.913262] Call Trace:\n[ 4758.913267]  <TASK>\n[ 4758.913299]  __mutex_lock+0x1469/0x1560\n[ 4758.913408]  _cma_cancel_listens+0x312/0x3b0\n[ 4758.913413]  _destroy_id+0x363/0xee0\n[ 4758.913417]  smbdirect_socket_destroy_sync+0x17d5/0x2440\n[ 4758.913443]  smbdirect_socket_release+0x124/0x230\n[ 4758.913451]  ksmbd_rdma_stop_listening+0x9f/0x190\n[ 4758.913457]  ksmbd_conn_transport_destroy+0x65/0x3c0\n[ 4758.913463]  kill_server_store+0x1fb/0x2b0\n[ 4758.913501]  kernfs_fop_write_iter+0x349/0x4d0\n[ 4758.913507]  vfs_write+0x5e7/0xc70\n[ 4758.913528]  ksys_write+0x12a/0x210\n[ 4758.913541]  do_syscall_64+0x135/0x460\n[ 4758.913555]  entry_SYSCALL_64_after_hwframe+0x77/0x7f\n\nThe cosmetic one: releasing a child recurses into\nsmbdirect_socket_destroy(), which takes the child's own\nrdma_lock_handler() lock nested under the listener's.  The listener's\nand the child's cm_id are always different instances, so this cannot\ndeadlock for real; the CM core itself nests a new connection id's\nhandler_mutex under the listening id's in cma_ib_req_handler().  But\nlockdep only sees one lock class, reports possible recursive locking,\nand then disables itself, hiding real locking bugs for the rest of the\nrun:\n\n[ 2424.579653] WARNING: possible recursive locking detected\n[ 2424.581180] 7.1.0-next-20260623+ #89 Not tainted\n[ 2424.582548] --------------------------------------------\n[ 2424.584500] ksmbd.control/8854 is trying to acquire lock:\n[ 2424.586817] ffff888102303c20 (&id_priv->handler_mutex){+.+.}-{4:4}, at: smbdirect_socket_destroy_sync+0xc39/0x2440\n[ 2424.590590]\n[ 2424.590590] but task is already holding lock:\n[ 2424.591601] ffff888102046c20 (&id_priv->handler_mutex){+.+.}-{4:4}, at: smbdirect_socket_destroy_sync+0xc39/0x2440\n[ 2424.594178]\n[ 2424.594178] other info that might help us debug this:\n[ 2424.596634]  Possible unsafe locking scenario:\n[ 2424.596634]\n[ 2424.598841]        CPU0\n[ 2424.599765]        ----\n[ 2424.600695]   lock(&id_priv->handler_mutex);\n[ 2424.601836]   lock(&id_priv->handler_mutex);\n[ 2424.602590]\n[ 2424.602590]  *** DEADLOCK ***\n[ 2424.602590]\n[ 2424.604512]  May be due to missing lock nesting notation\n\nSplice the pending/ready children onto a local list under the\nlistener's listen.lock, while the handler lock is held so a concurrent\nCM CONNECT_REQUEST cannot add more, but defer the actual\nsmbdirect_socket_release() calls until after the listener's cm_id has\nbeen destroyed and its handler lock dropped.  The children are\nindependent sockets whose teardown needs neither the listener's\nhandler lock nor its cm_id.\n\nFound with ksmbdzzer [2], a KSMBD fuzzer that drives libFuzzer with a\nkcov-dataflow [1] coverage vector: it folds each instrumented\ncomparison/argument's runtime operand value together with its PC (the\ndefault arm mixes them as pc⊕val) so that a new operand value at a known\nsite counts as new coverage.\n\n[1] https://lwn.net/Articles/1077606/\n[2] https://github.com/yskzalloc/kcov-dataflow"}],"providerMetadata":{"dateUpdated":"2026-09-17T16:06:59.150Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/8ea83ef0c40ec4463695e22bc9ae43e29bcfede7"},{"url":"https://git.kernel.org/stable/c/db82fbe4bb68e68e4aef00ef5b79f92991d8ef8e"}],"title":"smb: smbdirect: release pending child sockets outside the handler lock","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-90171","datePublished":"2026-09-17T16:06:59.150Z","dateReserved":"2026-09-11T19:38:34.790Z","dateUpdated":"2026-09-17T16:06:59.150Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-09-17 17:17:10","lastModifiedDate":"2026-09-17 17:17:10","problem_types":[],"metrics":[],"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"90171","Ordinal":"1","Title":"smb: smbdirect: release pending child sockets outside the handle","CVE":"CVE-2026-90171","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"90171","Ordinal":"1","NoteData":"In the Linux kernel, the following vulnerability has been resolved:\n\nsmb: smbdirect: release pending child sockets outside the handler lock\n\nsmbdirect_socket_destroy() releases the listener's pending/ready child\nsockets while still holding the listener's handler lock, the\n&id_priv->handler_mutex taken via rdma_lock_handler(), not\nsc->listen.lock, and before the listener's own rdma_destroy_id().\nThat ordering has one real consequence and one cosmetic one.\n\nThe real one: smbdirect_socket_release() drops the child's last\nreference, which destroys the child's cm_id.  Doing that before the\nlistener's rdma_destroy_id() lets _cma_cancel_listens(), running from\nthe listener's _destroy_id(), walk an already freed child id_priv,\nwhich KASAN catches as a slab-use-after-free during listener shutdown:\n\n[ 4758.909130] BUG: KASAN: slab-use-after-free in __mutex_lock+0x1469/0x1560\n[ 4758.911450] Read of size 1 at addr ffff88821c381db4 by task ksmbd.control/1652\n[ 4758.913262] Call Trace:\n[ 4758.913267]  <TASK>\n[ 4758.913299]  __mutex_lock+0x1469/0x1560\n[ 4758.913408]  _cma_cancel_listens+0x312/0x3b0\n[ 4758.913413]  _destroy_id+0x363/0xee0\n[ 4758.913417]  smbdirect_socket_destroy_sync+0x17d5/0x2440\n[ 4758.913443]  smbdirect_socket_release+0x124/0x230\n[ 4758.913451]  ksmbd_rdma_stop_listening+0x9f/0x190\n[ 4758.913457]  ksmbd_conn_transport_destroy+0x65/0x3c0\n[ 4758.913463]  kill_server_store+0x1fb/0x2b0\n[ 4758.913501]  kernfs_fop_write_iter+0x349/0x4d0\n[ 4758.913507]  vfs_write+0x5e7/0xc70\n[ 4758.913528]  ksys_write+0x12a/0x210\n[ 4758.913541]  do_syscall_64+0x135/0x460\n[ 4758.913555]  entry_SYSCALL_64_after_hwframe+0x77/0x7f\n\nThe cosmetic one: releasing a child recurses into\nsmbdirect_socket_destroy(), which takes the child's own\nrdma_lock_handler() lock nested under the listener's.  The listener's\nand the child's cm_id are always different instances, so this cannot\ndeadlock for real; the CM core itself nests a new connection id's\nhandler_mutex under the listening id's in cma_ib_req_handler().  But\nlockdep only sees one lock class, reports possible recursive locking,\nand then disables itself, hiding real locking bugs for the rest of the\nrun:\n\n[ 2424.579653] WARNING: possible recursive locking detected\n[ 2424.581180] 7.1.0-next-20260623+ #89 Not tainted\n[ 2424.582548] --------------------------------------------\n[ 2424.584500] ksmbd.control/8854 is trying to acquire lock:\n[ 2424.586817] ffff888102303c20 (&id_priv->handler_mutex){+.+.}-{4:4}, at: smbdirect_socket_destroy_sync+0xc39/0x2440\n[ 2424.590590]\n[ 2424.590590] but task is already holding lock:\n[ 2424.591601] ffff888102046c20 (&id_priv->handler_mutex){+.+.}-{4:4}, at: smbdirect_socket_destroy_sync+0xc39/0x2440\n[ 2424.594178]\n[ 2424.594178] other info that might help us debug this:\n[ 2424.596634]  Possible unsafe locking scenario:\n[ 2424.596634]\n[ 2424.598841]        CPU0\n[ 2424.599765]        ----\n[ 2424.600695]   lock(&id_priv->handler_mutex);\n[ 2424.601836]   lock(&id_priv->handler_mutex);\n[ 2424.602590]\n[ 2424.602590]  *** DEADLOCK ***\n[ 2424.602590]\n[ 2424.604512]  May be due to missing lock nesting notation\n\nSplice the pending/ready children onto a local list under the\nlistener's listen.lock, while the handler lock is held so a concurrent\nCM CONNECT_REQUEST cannot add more, but defer the actual\nsmbdirect_socket_release() calls until after the listener's cm_id has\nbeen destroyed and its handler lock dropped.  The children are\nindependent sockets whose teardown needs neither the listener's\nhandler lock nor its cm_id.\n\nFound with ksmbdzzer [2], a KSMBD fuzzer that drives libFuzzer with a\nkcov-dataflow [1] coverage vector: it folds each instrumented\ncomparison/argument's runtime operand value together with its PC (the\ndefault arm mixes them as pc⊕val) so that a new operand value at a known\nsite counts as new coverage.\n\n[1] https://lwn.net/Articles/1077606/\n[2] https://github.com/yskzalloc/kcov-dataflow","Type":"Description","Title":"smb: smbdirect: release pending child sockets outside the handle"}]}}}