This is a note to let you know that I've just added the patch titled smb3: do not attempt multichannel to server which does not support it to the 5.12-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: smb3-do-not-attempt-multichannel-to-server-which-does-not-support-it.patch and it can be found in the queue-5.12 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 9c2dc11df50d1c8537075ff6b98472198e24438e Mon Sep 17 00:00:00 2001 From: Steve French <stfrench@xxxxxxxxxxxxx> Date: Fri, 7 May 2021 20:00:41 -0500 Subject: smb3: do not attempt multichannel to server which does not support it From: Steve French <stfrench@xxxxxxxxxxxxx> 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@xxxxxxxxxxxxx> Reviewed-By: Tom Talpey <tom@xxxxxxxxxx> Cc: <stable@xxxxxxxxxxxxxxx> # v5.8+ Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/cifs/sess.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c @@ -97,6 +97,12 @@ int cifs_try_adding_channels(struct cifs 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 Patches currently in stable-queue which might be from stfrench@xxxxxxxxxxxxx are queue-5.12/cifs-fix-regression-when-mounting-shares-with-prefix-paths.patch queue-5.12/smb2-fix-use-after-free-in-smb2_ioctl_query_info.patch queue-5.12/cifs-fix-leak-in-cifs_smb3_do_mount-ctx.patch queue-5.12/cifs-return-correct-error-code-from-smb2_get_enc_key.patch queue-5.12/cifs-detect-dead-connections-only-when-echoes-are-enabled.patch queue-5.12/cifs-fix-out-of-bound-memory-access-when-calling-smb3_notify-at-mount-point.patch queue-5.12/smb3-if-max_channels-set-to-more-than-one-channel-request-multichannel.patch queue-5.12/smb3-do-not-attempt-multichannel-to-server-which-does-not-support-it.patch queue-5.12/smb3-when-mounting-with-multichannel-include-it-in-requested-capabilities.patch