diff options
author | Steve French <stfrench@microsoft.com> | 2018-04-01 21:15:55 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2018-04-02 14:11:15 -0400 |
commit | 07108d0e7c7fbbf9c6d76c0af2f1813e4f3f0800 (patch) | |
tree | dc01c076ce918a4c8c4ef51035932dd8313caa8f /fs | |
parent | 7ea884c77e5c97f1e0a1a422d961d27f78ca2745 (diff) |
cifs: Add minor debug message during negprot
Check for unknown security mode flags during negotiate protocol
if debugging enabled.
Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/smb2pdu.c | 4 | ||||
-rw-r--r-- | fs/cifs/smb2pdu.h | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 0e04b577758d..f7741cee2a4c 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c | |||
@@ -584,8 +584,10 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) | |||
584 | SMB2_MAX_BUFFER_SIZE); | 584 | SMB2_MAX_BUFFER_SIZE); |
585 | server->max_read = le32_to_cpu(rsp->MaxReadSize); | 585 | server->max_read = le32_to_cpu(rsp->MaxReadSize); |
586 | server->max_write = le32_to_cpu(rsp->MaxWriteSize); | 586 | server->max_write = le32_to_cpu(rsp->MaxWriteSize); |
587 | /* BB Do we need to validate the SecurityMode? */ | ||
588 | server->sec_mode = le16_to_cpu(rsp->SecurityMode); | 587 | server->sec_mode = le16_to_cpu(rsp->SecurityMode); |
588 | if ((server->sec_mode & SMB2_SEC_MODE_FLAGS_ALL) != server->sec_mode) | ||
589 | cifs_dbg(FYI, "Server returned unexpected security mode 0x%x\n", | ||
590 | server->sec_mode); | ||
589 | server->capabilities = le32_to_cpu(rsp->Capabilities); | 591 | server->capabilities = le32_to_cpu(rsp->Capabilities); |
590 | /* Internal types */ | 592 | /* Internal types */ |
591 | server->capabilities |= SMB2_NT_FIND | SMB2_LARGE_FILES; | 593 | server->capabilities |= SMB2_NT_FIND | SMB2_LARGE_FILES; |
diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h index 8b901c69a65a..253e2c7c952f 100644 --- a/fs/cifs/smb2pdu.h +++ b/fs/cifs/smb2pdu.h | |||
@@ -249,6 +249,8 @@ struct smb2_negotiate_req { | |||
249 | /* SecurityMode flags */ | 249 | /* SecurityMode flags */ |
250 | #define SMB2_NEGOTIATE_SIGNING_ENABLED 0x0001 | 250 | #define SMB2_NEGOTIATE_SIGNING_ENABLED 0x0001 |
251 | #define SMB2_NEGOTIATE_SIGNING_REQUIRED 0x0002 | 251 | #define SMB2_NEGOTIATE_SIGNING_REQUIRED 0x0002 |
252 | #define SMB2_SEC_MODE_FLAGS_ALL 0x0003 | ||
253 | |||
252 | /* Capabilities flags */ | 254 | /* Capabilities flags */ |
253 | #define SMB2_GLOBAL_CAP_DFS 0x00000001 | 255 | #define SMB2_GLOBAL_CAP_DFS 0x00000001 |
254 | #define SMB2_GLOBAL_CAP_LEASING 0x00000002 /* Resp only New to SMB2.1 */ | 256 | #define SMB2_GLOBAL_CAP_LEASING 0x00000002 /* Resp only New to SMB2.1 */ |