Skip to contentSkip to conversation

target: avoid NULL dereference in CHAP auth error path

PATCH Nicholas A. Bellinger 1 participant 1 message Jan 12, 2018 SCSI target

lore
Share & tools
lore

Nicholas A. Bellinger

author Applied
#0 lore raw

Hi David,

Apologies for the delayed follow up.

Quoted 7 lines · David Disseldorp

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 69110e3cedbb ("iscsi-target: Use shash and ahash")
Quoted 8 lines

---
This is a minimal fix, similar to Markus's
"target/iscsi: Less function calls in chap_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.