Skip to content

Commit 679971e

Browse files
committed
smb3: when mounting with multichannel include it in requested capabilities
In the SMB3/SMB3.1.1 negotiate protocol request, we are supposed to advertise CAP_MULTICHANNEL capability when establishing multiple channels has been requested by the user doing the mount. See MS-SMB2 sections 2.2.3 and 3.2.5.2 Without setting it there is some risk that multichannel could fail if the server interpreted the field strictly. Reviewed-By: Tom Talpey <[email protected]> Reviewed-by: Shyam Prasad N <[email protected]> Cc: <[email protected]> # v5.8+ Signed-off-by: Steve French <[email protected]>
1 parent 7c9e41e commit 679971e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fs/cifs/smb2pdu.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,8 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
841841
req->SecurityMode = 0;
842842

843843
req->Capabilities = cpu_to_le32(server->vals->req_capabilities);
844+
if (ses->chan_max > 1)
845+
req->Capabilities |= cpu_to_le32(SMB2_GLOBAL_CAP_MULTI_CHANNEL);
844846

845847
/* ClientGUID must be zero for SMB2.02 dialect */
846848
if (server->vals->protocol_id == SMB20_PROT_ID)
@@ -1032,6 +1034,9 @@ int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon)
10321034

10331035
pneg_inbuf->Capabilities =
10341036
cpu_to_le32(server->vals->req_capabilities);
1037+
if (tcon->ses->chan_max > 1)
1038+
pneg_inbuf->Capabilities |= cpu_to_le32(SMB2_GLOBAL_CAP_MULTI_CHANNEL);
1039+
10351040
memcpy(pneg_inbuf->Guid, server->client_guid,
10361041
SMB2_CLIENT_GUID_SIZE);
10371042

0 commit comments

Comments
 (0)