]> www.infradead.org Git - users/jedix/linux-maple.git/commit
cifs: Correctly set SMB1 SessionKey field in Session Setup Request
authorPali Rohár <pali@kernel.org>
Sat, 2 Nov 2024 16:58:31 +0000 (17:58 +0100)
committerSteve French <stfrench@microsoft.com>
Mon, 2 Jun 2025 01:43:49 +0000 (20:43 -0500)
commit89381c72d52094988e11d23ef24a00066a0fa458
tree7af73bc598fd28847b0f3726fe4f464a7bb5b3fb
parent6510ef4230b68c960309e0c1d6eb3e32eb785142
cifs: Correctly set SMB1 SessionKey field in Session Setup Request

[MS-CIFS] specification in section 2.2.4.53.1 where is described
SMB_COM_SESSION_SETUP_ANDX Request, for SessionKey field says:

    The client MUST set this field to be equal to the SessionKey field in
    the SMB_COM_NEGOTIATE Response for this SMB connection.

Linux SMB client currently set this field to zero. This is working fine
against Windows NT SMB servers thanks to [MS-CIFS] product behavior <94>:

    Windows NT Server ignores the client's SessionKey.

For compatibility with [MS-CIFS], set this SessionKey field in Session
Setup Request to value retrieved from Negotiate response.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/cifsglob.h
fs/smb/client/cifspdu.h
fs/smb/client/cifssmb.c
fs/smb/client/sess.c