Commit 9c2dc11d authored by Steve French's avatar Steve French
Browse files

smb3: do not attempt multichannel to server which does not support it



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: default avatarShyam Prasad N <sprasad@microsoft.com>
Reviewed-By: default avatarTom Talpey <tom@talpey.com>
Cc: <stable@vger.kernel.org> # v5.8+
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 679971e7
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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