smb: fix secondary channel creation issue with kerberos by populating hostname when...
authorBharath SM <bharathsm@microsoft.com>
Mon, 17 Mar 2025 10:27:27 +0000 (15:57 +0530)
committerSteve French <stfrench@microsoft.com>
Wed, 18 Jun 2025 18:27:45 +0000 (13:27 -0500)
When mounting a share with kerberos authentication with multichannel
support, share mounts correctly, but fails to create secondary
channels. This occurs because the hostname is not populated when
adding the channels. The hostname is necessary for the userspace
cifs.upcall program to retrieve the required credentials and pass
it back to kernel, without hostname secondary channels fails
establish.

Cc: stable@vger.kernel.org
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Bharath SM <bharathsm@microsoft.com>
Reported-by: xfuren <xfuren@gmail.com>
Link: https://bugzilla.samba.org/show_bug.cgi?id=15824
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/sess.c

index ec0db32c7d9867204382beeb36428c53d59ef73e..330bc3d25badd80d08cf52fb21a22c954fc51df7 100644 (file)
@@ -498,8 +498,7 @@ cifs_ses_add_channel(struct cifs_ses *ses,
        ctx->domainauto = ses->domainAuto;
        ctx->domainname = ses->domainName;
 
-       /* no hostname for extra channels */
-       ctx->server_hostname = "";
+       ctx->server_hostname = ses->server->hostname;
 
        ctx->username = ses->user_name;
        ctx->password = ses->password;