From: Luis de Bethencourt Date: Wed, 8 Jun 2016 16:02:32 +0000 (+0100) Subject: cifs: check hash calculating succeeded X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a6b6befbb2806697461962edb044e3376a771ebb;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Steve French --- 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;