]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ksmbd: handle channel binding with a different user
authorNamjae Jeon <linkinjeon@kernel.org>
Thu, 2 Jul 2026 11:07:25 +0000 (20:07 +0900)
committerSteve French <stfrench@microsoft.com>
Mon, 6 Jul 2026 12:55:41 +0000 (07:55 -0500)
commit1c5daa2ea924be89d78b5525510bcf3a3eb9735c
treef045818121ce3dc2008fe41e9779cbf3255b63b7
parentfaf8578c77f3d846aca9cd882c293e03eafcc6df
ksmbd: handle channel binding with a different user

When an authenticated user tries to bind a channel to a session owned by a
different user, ksmbd returns STATUS_LOGON_FAILURE. Windows instead rejects
this attempt with STATUS_ACCESS_DENIED. The supplied credentials are valid
but cannot be used with the existing session.

Use a distinct internal error for a user mismatch in both NTLM and Kerberos
authentication and map it to STATUS_ACCESS_DENIED during SESSION_SETUP.
Keep ordinary authentication failures mapped to STATUS_LOGON_FAILURE.

A failed SMB 3.1.1 binding also leaves its preauthentication context on the
connection. A subsequent binding attempt for the same session reuses the
stale hash and derives an incorrect channel signing key. Remove the binding
preauthentication context on failure so a valid retry starts with a fresh
hash.

This fixes smb2.session.bind_different_user.

Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/server/auth.c
fs/smb/server/smb2pdu.c