Commit c577ab7b authored by Mike Christie's avatar Mike Christie Committed by Martin K. Petersen
Browse files

scsi: iscsi: Fix HW conn removal use after free

If qla4xxx doesn't remove the connection before the session, the iSCSI
class tries to remove the connection for it. We were doing a
iscsi_put_conn() in the iter function which is not needed and will result
in a use after free because iscsi_remove_conn() will free the connection.

Link: https://lore.kernel.org/r/20220616222738.5722-2-michael.christie@oracle.com


Tested-by: default avatarNilesh Javali <njavali@marvell.com>
Reviewed-by: default avatarLee Duncan <lduncan@suse.com>
Reviewed-by: default avatarNilesh Javali <njavali@marvell.com>
Signed-off-by: default avatarMike Christie <michael.christie@oracle.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent f54912b2
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -2138,8 +2138,6 @@ static int iscsi_iter_destroy_conn_fn(struct device *dev, void *data)
		return 0;

	iscsi_remove_conn(iscsi_dev_to_conn(dev));
	iscsi_put_conn(iscsi_dev_to_conn(dev));

	return 0;
}