]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cifs: Fix encoding of SMB1 Session Setup Kerberos Request in non-UNICODE mode
authorPali Rohár <pali@kernel.org>
Sun, 6 Oct 2024 17:20:13 +0000 (19:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:51:00 +0000 (07:51 +0200)
commite5208da73954b651ba4d80c0348da58178d716a9
tree570a2958ab4888b0da21d7119317168c6249dceb
parentf444c139e820f8a09c3c76194e0f061009038659
cifs: Fix encoding of SMB1 Session Setup Kerberos Request in non-UNICODE mode

[ Upstream commit 16cb6b0509b65ac89187e9402e0b7a9ddf1765ef ]

Like in UNICODE mode, SMB1 Session Setup Kerberos Request contains oslm and
domain strings.

Extract common code into ascii_oslm_strings() and ascii_domain_string()
functions (similar to unicode variants) and use these functions in
non-UNICODE code path in sess_auth_kerberos().

Decision if non-UNICODE or UNICODE mode is used is based on the
SMBFLG2_UNICODE flag in Flags2 packed field, and not based on the
capabilities of server. Fix this check too.

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/sess.c