Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 854D94ED1AF for ; Thu, 17 Sep 2026 16:20:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789662003; cv=none; b=M3pGKw49DAlI7LnvtlnfyI5947nppk1PYmMuTKnb3978crLvlcblrSS7SeI9054fbOspsV/zfEQmxaSVE+filjVBWhj9yQO7JblkDYD/pq4AXzd9et1TqPLxiUhFk/S+/BZsGBsRA+RpLK/dF60akZ1du3zQro/fN/e/unSYu7Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789662003; c=relaxed/simple; bh=n6JqVotwu1d3or5fIpQ1uK+fRz4FmIvIl6pjK1KEzSU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=AUHLf7tiN15NgEGtxOr9J3/qBruDCHVwW8wef6OFzAZDt6u0tLSrSiXDQ7TwS751UutPJAfN98KWWdUHftrjdiM/f+0SwOfY6tlR/36A6wtzSDXj2OOkDb3OKBgdfHdA0HquWyHOAlAycVGf+3OkreXPLueXezd1ERp7gYYAMFA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=wY6jsD4r; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="wY6jsD4r" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC34A1F000FF; Thu, 17 Sep 2026 16:20:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789662001; bh=Yd0kW5jTUj+EhdJiQHsV2MKPHt5BiE3RKnklJuTB7Ms=; h=From:To:Cc:Subject:Date:Reply-To; b=wY6jsD4rFR5CMBQcDru8ZhZ13rGKI2AxFs6lAFJ42D1gEt3U2HUEanAnWvQVV5gNR JVCXZS05ulNnvtXYJGEbV+lsHL0HDxTjAjy9S29bbEvnP6gifzKj4U/MB9npZSYKY9 d1ADMbYDAr35zZKoYaa2BAyGNs1zBJBqo5qh8fO4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-90171: smb: smbdirect: release pending child sockets outside the handler lock Date: Thu, 17 Sep 2026 17:10:01 +0100 Message-ID: <2026091727-CVE-2026-90171-a915@gregkh> X-Mailer: git-send-email 2.55.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=5628; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=If0Xs8RG6s/5ZP0M+Bc0/rn0FMHfs15EYig2IKOAJo0=; b=owGbwMvMwCRo6H6F97bub03G02pJDFlrBGoCbDoC1CYp8iwKaGt8IbPsqb2ATd0MLxYhVg+GL aGTrlztiGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgIncimZYcGYZS6VV0o/HXUfK iq5UByyf+avsJsP81JZ3qRkHbwfM+L+59/Lr8ptGTpqOAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: smb: smbdirect: release pending child sockets outside the handler lock smbdirect_socket_destroy() releases the listener's pending/ready child sockets while still holding the listener's handler lock, the &id_priv->handler_mutex taken via rdma_lock_handler(), not sc->listen.lock, and before the listener's own rdma_destroy_id(). That ordering has one real consequence and one cosmetic one. The real one: smbdirect_socket_release() drops the child's last reference, which destroys the child's cm_id. Doing that before the listener's rdma_destroy_id() lets _cma_cancel_listens(), running from the listener's _destroy_id(), walk an already freed child id_priv, which KASAN catches as a slab-use-after-free during listener shutdown: [ 4758.909130] BUG: KASAN: slab-use-after-free in __mutex_lock+0x1469/0x1560 [ 4758.911450] Read of size 1 at addr ffff88821c381db4 by task ksmbd.control/1652 [ 4758.913262] Call Trace: [ 4758.913267] [ 4758.913299] __mutex_lock+0x1469/0x1560 [ 4758.913408] _cma_cancel_listens+0x312/0x3b0 [ 4758.913413] _destroy_id+0x363/0xee0 [ 4758.913417] smbdirect_socket_destroy_sync+0x17d5/0x2440 [ 4758.913443] smbdirect_socket_release+0x124/0x230 [ 4758.913451] ksmbd_rdma_stop_listening+0x9f/0x190 [ 4758.913457] ksmbd_conn_transport_destroy+0x65/0x3c0 [ 4758.913463] kill_server_store+0x1fb/0x2b0 [ 4758.913501] kernfs_fop_write_iter+0x349/0x4d0 [ 4758.913507] vfs_write+0x5e7/0xc70 [ 4758.913528] ksys_write+0x12a/0x210 [ 4758.913541] do_syscall_64+0x135/0x460 [ 4758.913555] entry_SYSCALL_64_after_hwframe+0x77/0x7f The cosmetic one: releasing a child recurses into smbdirect_socket_destroy(), which takes the child's own rdma_lock_handler() lock nested under the listener's. The listener's and the child's cm_id are always different instances, so this cannot deadlock for real; the CM core itself nests a new connection id's handler_mutex under the listening id's in cma_ib_req_handler(). But lockdep only sees one lock class, reports possible recursive locking, and then disables itself, hiding real locking bugs for the rest of the run: [ 2424.579653] WARNING: possible recursive locking detected [ 2424.581180] 7.1.0-next-20260623+ #89 Not tainted [ 2424.582548] -------------------------------------------- [ 2424.584500] ksmbd.control/8854 is trying to acquire lock: [ 2424.586817] ffff888102303c20 (&id_priv->handler_mutex){+.+.}-{4:4}, at: smbdirect_socket_destroy_sync+0xc39/0x2440 [ 2424.590590] [ 2424.590590] but task is already holding lock: [ 2424.591601] ffff888102046c20 (&id_priv->handler_mutex){+.+.}-{4:4}, at: smbdirect_socket_destroy_sync+0xc39/0x2440 [ 2424.594178] [ 2424.594178] other info that might help us debug this: [ 2424.596634] Possible unsafe locking scenario: [ 2424.596634] [ 2424.598841] CPU0 [ 2424.599765] ---- [ 2424.600695] lock(&id_priv->handler_mutex); [ 2424.601836] lock(&id_priv->handler_mutex); [ 2424.602590] [ 2424.602590] *** DEADLOCK *** [ 2424.602590] [ 2424.604512] May be due to missing lock nesting notation Splice the pending/ready children onto a local list under the listener's listen.lock, while the handler lock is held so a concurrent CM CONNECT_REQUEST cannot add more, but defer the actual smbdirect_socket_release() calls until after the listener's cm_id has been destroyed and its handler lock dropped. The children are independent sockets whose teardown needs neither the listener's handler lock nor its cm_id. Found with ksmbdzzer [2], a KSMBD fuzzer that drives libFuzzer with a kcov-dataflow [1] coverage vector: it folds each instrumented comparison/argument's runtime operand value together with its PC (the default arm mixes them as pc⊕val) so that a new operand value at a known site counts as new coverage. [1] https://lwn.net/Articles/1077606/ [2] https://github.com/yskzalloc/kcov-dataflow The Linux kernel CVE team has assigned CVE-2026-90171 to this issue. Affected and fixed versions =========================== Issue introduced in 7.1 with commit dc691b91ad1677def14582a279e56fd943b52f94 and fixed in 7.2.6 with commit 8ea83ef0c40ec4463695e22bc9ae43e29bcfede7 Issue introduced in 7.1 with commit dc691b91ad1677def14582a279e56fd943b52f94 and fixed in 7.3-rc1 with commit db82fbe4bb68e68e4aef00ef5b79f92991d8ef8e Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2026-90171 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: fs/smb/smbdirect/socket.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/8ea83ef0c40ec4463695e22bc9ae43e29bcfede7 https://git.kernel.org/stable/c/db82fbe4bb68e68e4aef00ef5b79f92991d8ef8e