diff options
author | Steve French <smfrench@gmail.com> | 2015-09-22 03:16:27 -0500 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2015-09-24 00:53:31 -0500 |
commit | 88627148400e37b4bff197285d348fc05c9de013 (patch) | |
tree | 1643389ce75ff2f6e58818c53aafc148708b0ce7 /fs | |
parent | ceb1b0b9b4d1089e9f2731a314689ae17784c861 (diff) | |
download | op-kernel-dev-88627148400e37b4bff197285d348fc05c9de013.zip op-kernel-dev-88627148400e37b4bff197285d348fc05c9de013.tar.gz |
fix encryption error checks on mount
Signed-off-by: Steve French <steve.french@primarydata.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/smb2pdu.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index e543431..ce83e2e 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, if (tcon && tcon->bad_network_name) return -ENOENT; + if ((tcon->seal) && + ((ses->server->capabilities & SMB2_GLOBAL_CAP_ENCRYPTION) == 0)) { + cifs_dbg(VFS, "encryption requested but no server support"); + return -EOPNOTSUPP; + } + unc_path = kmalloc(MAX_SHARENAME_LENGTH * 2, GFP_KERNEL); if (unc_path == NULL) return -ENOMEM; @@ -1001,6 +1007,8 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, ((tcon->share_flags & SHI1005_FLAGS_DFS) == 0)) cifs_dbg(VFS, "DFS capability contradicts DFS flag\n"); init_copy_chunk_defaults(tcon); + if (tcon->share_flags & SHI1005_FLAGS_ENCRYPT_DATA) + cifs_dbg(VFS, "Encrypted shares not supported"); if (tcon->ses->server->ops->validate_negotiate) rc = tcon->ses->server->ops->validate_negotiate(xid, tcon); tcon_exit: |