target: avoid NULL dereference in CHAP auth error path
Nicholas A. Bellinger
AppliedHi David,
Apologies for the delayed follow up.
Quoted 7 lines · David Disseldorp
If
chap_server_compute_md5()fails early, e.g. viaCHAP_Nmismatch, thencrypto_free_shash()is called with a NULL pointer which gets dereferenced incrypto_shash_tfm().Fixes 69110e3cedbb ("iscsi-target: Use shash and ahash")Suggested-by Markus Elfring <[email protected]>Signed-off-by David Disseldorp <[email protected]>
Quoted 8 lines
---
This is a minimal fix, similar to Markus's
"target/iscsi: Less function calls inchap_server_compute_md5()after error detection" patch, but without all of the coding-style changes mixed in.drivers/target/iscsi/iscsi_target_auth.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Applied, with a stable CC' for 4.6.y.