summaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorLuis de Bethencourt <luisbg@osg.samsung.com>2016-06-08 18:02:32 +0200
committerSteve French <smfrench@gmail.com>2016-06-24 06:45:17 +0200
commita6b6befbb2806697461962edb044e3376a771ebb (patch)
tree6881983b05ca1f23ba81788d7d4c829eaebbf839 /fs/cifs
parentcifs: dynamic allocation of ntlmssp blob (diff)
downloadlinux-a6b6befbb2806697461962edb044e3376a771ebb.tar.xz
linux-a6b6befbb2806697461962edb044e3376a771ebb.zip
cifs: check hash calculating succeeded
calc_lanman_hash() could return -ENOMEM or other errors, we should check that everything went fine before using the calculated key. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/sess.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index a42e99c8e00e..538d9b55699a 100644
--- a/fs/cifs/sess.c
+++ b/fs/cifs/sess.c
@@ -710,6 +710,8 @@ sess_auth_lanman(struct sess_data *sess_data)
rc = calc_lanman_hash(ses->password, ses->server->cryptkey,
ses->server->sec_mode & SECMODE_PW_ENCRYPT ?
true : false, lnm_session_key);
+ if (rc)
+ goto out;
memcpy(bcc_ptr, (char *)lnm_session_key, CIFS_AUTH_RESP_SIZE);
bcc_ptr += CIFS_AUTH_RESP_SIZE;