diff options
author | Steve French <stfrench@microsoft.com> | 2021-05-08 04:00:41 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-05-11 15:47:37 +0300 |
commit | d35c4c959eb48c0f14179dbeb28672bdd400b1c9 (patch) | |
tree | 399593f78afae73dde7c22c942def2bf54ddc85f /fs/cifs | |
parent | 796b8263752890976b8df9692852ec8fcb36549a (diff) | |
download | linux-d35c4c959eb48c0f14179dbeb28672bdd400b1c9.tar.xz |
smb3: do not attempt multichannel to server which does not support it
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>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/sess.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index c2fe85ca2ded..1a0298d1e7cd 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c @@ -92,6 +92,12 @@ int cifs_try_adding_channels(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 |