]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 6 Jul 2025 08:57:53 +0000 (10:57 +0200)
commit3a1901ec0ab04a5cbce416e16d340ecf69687e4e
tree519b42e8fa9979b586fc77f31563b94aeb616033
parent7e69c33e4858ea275b2e1c0bf0bea13199e7e91b
cifs: Correctly set SMB1 SessionKey field in Session Setup Request

[ Upstream commit 89381c72d52094988e11d23ef24a00066a0fa458 ]

[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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/smb/client/cifsglob.h
fs/smb/client/cifspdu.h
fs/smb/client/cifssmb.c
fs/smb/client/sess.c