]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: libiscsi: Add iscsi_cls_conn to sysfs after initialization
authorWenchao Hao <haowenchao@huawei.com>
Thu, 10 Mar 2022 01:57:58 +0000 (20:57 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 15 Mar 2022 04:19:50 +0000 (00:19 -0400)
commitd8446604fb0a7a83d685d6bb25f4407a5a458116
tree659ba5e8d407b26d135cb2aa03e35b7dc37813ac
parent9093330b5e4cf917c81a731b71e9b487cd51fe37
scsi: libiscsi: Add iscsi_cls_conn to sysfs after initialization

iscsi_create_conn() exposed iscsi_cls_conn to sysfs prior to initialization
of iscsi_conn's dd_data. When userspace tried to access an attribute such
as the connect address, a NULL pointer dereference was observed.

Do not add iscsi_cls_conn to sysfs until it has been initialized.  Remove
iscsi_create_conn() since it is no longer used.

Link: https://lore.kernel.org/r/20220310015759.3296841-3-haowenchao@huawei.com
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
Signed-off-by: Wu Bo <wubo40@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/libiscsi.c
drivers/scsi/scsi_transport_iscsi.c
include/scsi/scsi_transport_iscsi.h