From mboxrd@z Thu Jan 1 00:00:00 1970 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 DA73D3B71AC; Thu, 17 Sep 2026 18:05:41 +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=1789668342; cv=none; b=X7IiBGh7bnN48fKzbw4EtfoB7El6j7RKg2cDhQiKsV1wP5SLhz9KIqo7gMsXeRqx4K3iSQKQL6lOaaOR8NymvF6dqqk+OVB/FZKtzELAXaq8M2I9QhgcdJobh+JiekwL6S+th/2T9UVhwfMLpGw/r4Ku8AdKZ28hTdtSLrnms6k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789668342; c=relaxed/simple; bh=8cnSF+Biklrh0RgHyHIW49CgafKPA97s7uyzPMcW2jM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Of9YCTY/5UgOGxfoIQphCliNuT2EWCSc05eIHdnARuz29iX4Gvb7SX32IzbH2cSAcoS2n5+xkDCLuJ4QBKF0ImEckW/+kSNgnjrfsx2hTYuEUiDMhDG4lkSb1vOMI488eGKTKVxGagYqdfl3e65+JqMIpJIH/AoEdDU94j+wMlY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qHi1K36l; 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="qHi1K36l" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33BC21F000FF; Thu, 17 Sep 2026 18:05:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789668341; bh=gfB19G3IkRMCcUhQouxs4gQen+SxbBemHL0EqlKP9Oc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=qHi1K36lZzbpcERqiWHE1gO130nXV+oPy453TlKp22WFt8vfOPYmsxtmzLzlo0Uu0 CErp+LKk8IUgKncRx0Oeaug8LWQuc7KADupn853WoIZn0YSXA/SOIFusbkedzSFr62 pyeuqRT0QO49GXI32AJP1+8CsWeiu9xZHqrzbGFA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Namjae Jeon , Steve French , Sasha Levin Subject: [PATCH 6.12 0393/1102] ksmbd: find bound sessions during reauthentication Date: Thu, 17 Sep 2026 16:05:36 +0100 Message-ID: <20260917151549.524003950@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260917151539.408551884@linuxfoundation.org> References: <20260917151539.408551884@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Namjae Jeon [ Upstream commit faf8578c77f3d846aca9cd882c293e03eafcc6df ] A session bound to an additional connection is stored in the session channel list, but it is not added to that connection's local session table. After the binding exchange completes, conn->binding is cleared. A later SESSION_SETUP reauthentication on the bound channel only searches the local session table. It fails to find the session and returns STATUS_USER_SESSION_DELETED instead of processing authentication and returning STATUS_LOGON_FAILURE for invalid credentials. If the local lookup fails, look up the session globally and accept it only when the current connection is registered in its channel list. This keeps unbound connections from using the session while allowing reauthentication on an established channel. This fixes smb2.session.bind_invalid_auth. Signed-off-by: Namjae Jeon Signed-off-by: Steve French Signed-off-by: Sasha Levin --- fs/smb/server/smb2pdu.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c index 5526006979269..464970f3af7c3 100644 --- a/fs/smb/server/smb2pdu.c +++ b/fs/smb/server/smb2pdu.c @@ -1804,6 +1804,13 @@ int smb2_sess_setup(struct ksmbd_work *work) } else { sess = ksmbd_session_lookup(conn, le64_to_cpu(req->hdr.SessionId)); + if (!sess) { + sess = ksmbd_session_lookup_slowpath(le64_to_cpu(req->hdr.SessionId)); + if (sess && !lookup_chann_list(sess, conn)) { + ksmbd_user_session_put(sess); + sess = NULL; + } + } if (!sess) { rc = -ENOENT; goto out_err; -- 2.53.0