lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <486018fb-edf9-1f58-d911-ca7c5e9451e2@sangfor.com.cn>
Date:   Sat, 11 Sep 2021 17:37:04 +0800
From:   Ding Hui <dinghui@...gfor.com.cn>
To:     Mike Christie <michael.christie@...cle.com>, lduncan@...e.com,
        cleech@...hat.com, jejb@...ux.ibm.com, martin.petersen@...cle.com,
        open-iscsi@...glegroups.com, linux-scsi@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] scsi: libiscsi: move init ehwait to
 iscsi_session_setup()

On 2021/9/11 12:25 上午, Mike Christie wrote:
> On 9/9/21 8:02 PM, Ding Hui wrote:
>> commit ec29d0ac29be ("scsi: iscsi: Fix conn use after free during
>> resets") move member ehwait from conn to session, but left init ehwait
>> in iscsi_conn_setup().
>>
>> Due to one session can be binded by multi conns, the conn after the
> 
> A session can only have 1 conn. There is some code that makes it look
> like we can do multiple conns or swap the single conn, but it was never
> fully implemented/supported upstream.
> 
> However, I like the patch. The init should be done in iscsi_session_setup,
> so could you fix up the commit, so it's correct?
> 

Thanks,I'll update the commit log and send v2 1/3.

>> first will reinit the session->ehwait, move init ehwait to
>> iscsi_session_setup() to fix it.
>>
>> Fixes: ec29d0ac29be ("scsi: iscsi: Fix conn use after free during resets")
>> Signed-off-by: Ding Hui <dinghui@...gfor.com.cn>
>> ---
>>   drivers/scsi/libiscsi.c | 3 +--
>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
>> index 4683c183e9d4..712a45368385 100644
>> --- a/drivers/scsi/libiscsi.c
>> +++ b/drivers/scsi/libiscsi.c
>> @@ -2947,6 +2947,7 @@ iscsi_session_setup(struct iscsi_transport *iscsit, struct Scsi_Host *shost,
>>   	session->tmf_state = TMF_INITIAL;
>>   	timer_setup(&session->tmf_timer, iscsi_tmf_timedout, 0);
>>   	mutex_init(&session->eh_mutex);
>> +	init_waitqueue_head(&session->ehwait);
>>   
>>   	spin_lock_init(&session->frwd_lock);
>>   	spin_lock_init(&session->back_lock);
>> @@ -3074,8 +3075,6 @@ iscsi_conn_setup(struct iscsi_cls_session *cls_session, int dd_size,
>>   		goto login_task_data_alloc_fail;
>>   	conn->login_task->data = conn->data = data;
>>   
>> -	init_waitqueue_head(&session->ehwait);
>> -
>>   	return cls_conn;
>>   
>>   login_task_data_alloc_fail:
>>
> 


-- 
Thanks,
-dinghui

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ