]> www.infradead.org Git - users/dwmw2/linux.git/commit
scsi: iscsi: set auth_protocol back to NULL if CHAP_A value is not supported
authorMaurizio Lombardi <mlombard@redhat.com>
Wed, 26 Jun 2019 17:27:34 +0000 (19:27 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jul 2019 05:28:18 +0000 (07:28 +0200)
commit63e8706d120772de99929692f7beeca9f668b90c
tree3650f20821605feaf7495f63e1dec490ed4c625d
parent83f31a44368f5ece05660524f97756d113ea5311
scsi: iscsi: set auth_protocol back to NULL if CHAP_A value is not supported

[ Upstream commit 5dd6c49339126c2c8df2179041373222362d6e49 ]

If the CHAP_A value is not supported, the chap_server_open() function
should free the auth_protocol pointer and set it to NULL, or we will leave
a dangling pointer around.

[   66.010905] Unsupported CHAP_A value
[   66.011660] Security negotiation failed.
[   66.012443] iSCSI Login negotiation failed.
[   68.413924] general protection fault: 0000 [#1] SMP PTI
[   68.414962] CPU: 0 PID: 1562 Comm: targetcli Kdump: loaded Not tainted 4.18.0-80.el8.x86_64 #1
[   68.416589] Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2011
[   68.417677] RIP: 0010:__kmalloc_track_caller+0xc2/0x210

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Reviewed-by: Chris Leech <cleech@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/target/iscsi/iscsi_target_auth.c