Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1417631 > unrolled thread
| Started by | Luis de Bethencourt <luisbg@osg.samsung.com> |
|---|---|
| First post | 2016-06-08 18:10 +0200 |
| Last post | 2016-06-08 18:10 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH] cifs: check hash calculating succeeded Luis de Bethencourt <luisbg@osg.samsung.com> - 2016-06-08 18:10 +0200
| From | Luis de Bethencourt <luisbg@osg.samsung.com> |
|---|---|
| Date | 2016-06-08 18:10 +0200 |
| Subject | [PATCH] cifs: check hash calculating succeeded |
| Message-ID | <rHOdk-2nA-17@gated-at.bofh.it> |
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> --- fs/cifs/sess.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index a42e99c..538d9b5 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; -- 2.5.1
Back to top | Article view | linux.kernel
csiph-web