summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSteve French <smfrench@gmail.com>2015-03-26 19:23:20 -0500
committerSteve French <smfrench@gmail.com>2015-04-01 00:01:46 -0500
commitf3a31a2bbbfe22db0313a4e270c7ba91baa7b630 (patch)
tree13b3fcfd35466602e87ecea7c9ff73099ce47852 /fs
parent75fdfc849ae0636853add4b7dbdc5753160ad0cb (diff)
downloadop-kernel-dev-f3a31a2bbbfe22db0313a4e270c7ba91baa7b630.zip
op-kernel-dev-f3a31a2bbbfe22db0313a4e270c7ba91baa7b630.tar.gz
Don't ignore errors on encrypting password in SMBTcon
Although unlikely to fail (and tree connect does not commonly send a password since SECMODE_USER is the default for most servers) do not ignore errors on SMBNTEncrypt in SMB Tree Connect. Reported by Coverity (CID 1226853) Signed-off-by: Steve French <smfrench@gmail.com> Acked-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com> Acked-by: Sachin Prabhu <sprabhu@redhat.com> Reviewed-by: Jeff Layton <jlayton@poochiereds.net>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/connect.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 4cb8450..cdb1aaf 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -3696,6 +3696,12 @@ CIFSTCon(const unsigned int xid, struct cifs_ses *ses,
#endif /* CIFS_WEAK_PW_HASH */
rc = SMBNTencrypt(tcon->password, ses->server->cryptkey,
bcc_ptr, nls_codepage);
+ if (rc) {
+ cifs_dbg(FYI, "%s Can't generate NTLM rsp. Error: %d\n",
+ __func__, rc);
+ cifs_buf_release(smb_buffer);
+ return rc;
+ }
bcc_ptr += CIFS_AUTH_RESP_SIZE;
if (ses->capabilities & CAP_UNICODE) {
OpenPOWER on IntegriCloud