mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
target/iscsi: avoid NULL dereference in CHAP auth error path
If chap_server_compute_md5() fails early, e.g. via CHAP_N mismatch, then
crypto_free_shash() is called with a NULL pointer which gets
dereferenced in crypto_shash_tfm().
Fixes: 69110e3ced ("iscsi-target: Use shash and ahash")
Suggested-by: Markus Elfring <[email protected]>
Signed-off-by: David Disseldorp <[email protected]>
Cc: [email protected] # 4.6+
Signed-off-by: Nicholas Bellinger <[email protected]>
This commit is contained in:
parent
093ec1430f
commit
ce512d79d0
1 changed files with 2 additions and 1 deletions
|
|
@ -421,7 +421,8 @@ static int chap_server_compute_md5(
|
|||
auth_ret = 0;
|
||||
out:
|
||||
kzfree(desc);
|
||||
crypto_free_shash(tfm);
|
||||
if (tfm)
|
||||
crypto_free_shash(tfm);
|
||||
kfree(challenge);
|
||||
kfree(challenge_binhex);
|
||||
return auth_ret;
|
||||
|
|
|
|||
Loading…
Reference in a new issue