aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve French <smfrench@gmail.com>2015-09-22 04:16:27 -0400
committerSteve French <smfrench@gmail.com>2015-09-24 01:53:31 -0400
commit88627148400e37b4bff197285d348fc05c9de013 (patch)
tree1643389ce75ff2f6e58818c53aafc148708b0ce7
parentceb1b0b9b4d1089e9f2731a314689ae17784c861 (diff)
fix encryption error checks on mount
Signed-off-by: Steve French <steve.french@primarydata.com>
-rw-r--r--fs/cifs/smb2pdu.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index e543431db916..ce83e2edbe0a 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -922,6 +922,12 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
922 if (tcon && tcon->bad_network_name) 922 if (tcon && tcon->bad_network_name)
923 return -ENOENT; 923 return -ENOENT;
924 924
925 if ((tcon->seal) &&
926 ((ses->server->capabilities & SMB2_GLOBAL_CAP_ENCRYPTION) == 0)) {
927 cifs_dbg(VFS, "encryption requested but no server support");
928 return -EOPNOTSUPP;
929 }
930
925 unc_path = kmalloc(MAX_SHARENAME_LENGTH * 2, GFP_KERNEL); 931 unc_path = kmalloc(MAX_SHARENAME_LENGTH * 2, GFP_KERNEL);
926 if (unc_path == NULL) 932 if (unc_path == NULL)
927 return -ENOMEM; 933 return -ENOMEM;
@@ -1001,6 +1007,8 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
1001 ((tcon->share_flags & SHI1005_FLAGS_DFS) == 0)) 1007 ((tcon->share_flags & SHI1005_FLAGS_DFS) == 0))
1002 cifs_dbg(VFS, "DFS capability contradicts DFS flag\n"); 1008 cifs_dbg(VFS, "DFS capability contradicts DFS flag\n");
1003 init_copy_chunk_defaults(tcon); 1009 init_copy_chunk_defaults(tcon);
1010 if (tcon->share_flags & SHI1005_FLAGS_ENCRYPT_DATA)
1011 cifs_dbg(VFS, "Encrypted shares not supported");
1004 if (tcon->ses->server->ops->validate_negotiate) 1012 if (tcon->ses->server->ops->validate_negotiate)
1005 rc = tcon->ses->server->ops->validate_negotiate(xid, tcon); 1013 rc = tcon->ses->server->ops->validate_negotiate(xid, tcon);
1006tcon_exit: 1014tcon_exit: