smb: client: fix session setup against servers that require SPN
authorPaulo Alcantara <pc@manguebit.org>
Fri, 25 Jul 2025 03:04:44 +0000 (00:04 -0300)
committerSteve French <stfrench@microsoft.com>
Sun, 27 Jul 2025 21:59:59 +0000 (16:59 -0500)
commit33cfdd726381828b9907a61c038a9f48b6690a31
treed6f45256a6d3b23443cbbfe14bdb9e074d54a203
parentbe77ab6b9fbe348daf3c2d3ee40f23ca5110a339
smb: client: fix session setup against servers that require SPN

Some servers might enforce the SPN to be set in the target info
blob (AV pairs) when sending NTLMSSP_AUTH message.  In Windows Server,
this could be enforced with SmbServerNameHardeningLevel set to 2.

Fix this by always appending SPN (cifs/<hostname>) to the existing
list of target infos when setting up NTLMv2 response blob.

Cc: linux-cifs@vger.kernel.org
Cc: David Howells <dhowells@redhat.com>
Reported-by: Pierguido Lambri <plambri@redhat.com>
Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/cifsencrypt.c