1 From 306cb65bb0cb243389fcbd0a66907d5bdea07d1e Mon Sep 17 00:00:00 2001
2 From: Bharath SM <bharathsm@microsoft.com>
3 Date: Mon, 17 Mar 2025 15:57:27 +0530
4 Subject: smb: fix secondary channel creation issue with kerberos by populating hostname when adding channels
6 From: Bharath SM <bharathsm@microsoft.com>
8 commit 306cb65bb0cb243389fcbd0a66907d5bdea07d1e upstream.
10 When mounting a share with kerberos authentication with multichannel
11 support, share mounts correctly, but fails to create secondary
12 channels. This occurs because the hostname is not populated when
13 adding the channels. The hostname is necessary for the userspace
14 cifs.upcall program to retrieve the required credentials and pass
15 it back to kernel, without hostname secondary channels fails
18 Cc: stable@vger.kernel.org
19 Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
20 Signed-off-by: Bharath SM <bharathsm@microsoft.com>
21 Reported-by: xfuren <xfuren@gmail.com>
22 Link: https://bugzilla.samba.org/show_bug.cgi?id=15824
23 Signed-off-by: Steve French <stfrench@microsoft.com>
24 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
26 fs/smb/client/sess.c | 3 +--
27 1 file changed, 1 insertion(+), 2 deletions(-)
29 --- a/fs/smb/client/sess.c
30 +++ b/fs/smb/client/sess.c
31 @@ -558,8 +558,7 @@ cifs_ses_add_channel(struct cifs_ses *se
32 ctx->domainauto = ses->domainAuto;
33 ctx->domainname = ses->domainName;
35 - /* no hostname for extra channels */
36 - ctx->server_hostname = "";
37 + ctx->server_hostname = ses->server->hostname;
39 ctx->username = ses->user_name;
40 ctx->password = ses->password;