]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
smb3: do not attempt multichannel to server which does not support it
authorSteve French <stfrench@microsoft.com>
Sat, 8 May 2021 01:00:41 +0000 (20:00 -0500)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 19 May 2021 08:32:25 +0000 (10:32 +0200)
BugLink: https://bugs.launchpad.net/bugs/1928857
commit 9c2dc11df50d1c8537075ff6b98472198e24438e upstream.

We were ignoring CAP_MULTI_CHANNEL in the server response - if the
server doesn't support multichannel we should not be attempting it.

See MS-SMB2 section 3.2.5.2

Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Reviewed-By: Tom Talpey <tom@talpey.com>
Cc: <stable@vger.kernel.org> # v5.8+
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
fs/cifs/sess.c

index dea4959989b50eee976256a41eea14f9d2bca6ff..b63f00894b0c31540af662c843a0620437e3bc26 100644 (file)
@@ -97,6 +97,12 @@ int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses)
                return 0;
        }
 
+       if (!(ses->server->capabilities & SMB2_GLOBAL_CAP_MULTI_CHANNEL)) {
+               cifs_dbg(VFS, "server %s does not support multichannel\n", ses->server->hostname);
+               ses->chan_max = 1;
+               return 0;
+       }
+
        /*
         * Make a copy of the iface list at the time and use that
         * instead so as to not hold the iface spinlock for opening