Skip to content

Commit

Permalink
scsi: iscsi: Fix HW conn removal use after free
Browse files Browse the repository at this point in the history
[ Upstream commit c577ab7 ]

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: Nilesh Javali <njavali@marvell.com>
Reviewed-by: Lee Duncan <lduncan@suse.com>
Reviewed-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
mikechristie authored and gregkh committed Aug 25, 2022
1 parent 5c4b699 commit 0483ffc
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/scsi/scsi_transport_iscsi.c
Expand Up @@ -2143,8 +2143,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;
}

Expand Down

0 comments on commit 0483ffc

Please sign in to comment.