From 21bfbb06957e07c5163ec053af536174c9fe853c Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Sat, 12 Jul 2025 15:54:00 +0800 Subject: [PATCH] scsi: iscsi: Fix HW conn removal use after free mainline inclusion from mainline-v6.0-rc1 commit c577ab7ba5f3bf9062db8a58b6e89d4fe370447e category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/ICGAAL CVE: CVE-2022-50031 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c577ab7ba5f3bf9062db8a58b6e89d4fe370447e -------------------------------- 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 Reviewed-by: Lee Duncan Reviewed-by: Nilesh Javali Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen Signed-off-by: Li Lingfeng --- drivers/scsi/scsi_transport_iscsi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index 9eb01315715d..c0a1dfce671a 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -2170,8 +2170,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; } -- Gitee