Re: iscsi target: Set conn->sess to NULL when iscsi_login_set_conn_values fails

2018-08-15 Thread Mike Christie
On 08/15/2018 10:59 AM, Mike Christie wrote: > On 08/15/2018 05:19 AM, Vincent Pelletier wrote: >> Fixes a use-after-free reported by KASAN when later >> iscsi_target_login_sess_out gets called and it tries to access >> conn->sess->se_sess: >> >> Disabling lock debugging due to kernel taint >>

Re: iscsi target: Set conn->sess to NULL when iscsi_login_set_conn_values fails

2018-08-15 Thread Mike Christie
On 08/15/2018 05:19 AM, Vincent Pelletier wrote: > Fixes a use-after-free reported by KASAN when later > iscsi_target_login_sess_out gets called and it tries to access > conn->sess->se_sess: > > Disabling lock debugging due to kernel taint > iSCSI Login timeout on Network Portal [::]:3260 > iSCSI

Re: iscsi target: Set conn->sess to NULL when iscsi_login_set_conn_values fails

2018-08-15 Thread Mike Christie
On 08/15/2018 10:44 AM, Mike Christie wrote: > On 08/15/2018 05:19 AM, Vincent Pelletier wrote: >> Fixes a use-after-free reported by KASAN when later >> iscsi_target_login_sess_out gets called and it tries to access >> conn->sess->se_sess: >> >> Disabling lock debugging due to kernel taint >>

Re: iscsi target: Set conn->sess to NULL when iscsi_login_set_conn_values fails

2018-08-15 Thread Vincent Pelletier
On Wed, 15 Aug 2018 10:44:34 -0500, Mike Christie wrote: > This is the issue I said was fixed in: > > https://www.spinics.net/lists/target-devel/msg17018.html I did apply this patch, yes. It misses the "if(...){kfree(sess); return ret;}" right after the iscsi_login_set_conn_values call, which

Re: iscsi target: Set conn->sess to NULL when iscsi_login_set_conn_values fails

2018-08-15 Thread Mike Christie
On 08/15/2018 05:19 AM, Vincent Pelletier wrote: > Fixes a use-after-free reported by KASAN when later > iscsi_target_login_sess_out gets called and it tries to access > conn->sess->se_sess: > > Disabling lock debugging due to kernel taint > iSCSI Login timeout on Network Portal [::]:3260 > iSCSI

Re: iscsi target: Set conn->sess to NULL when iscsi_login_set_conn_values fails

2018-08-15 Thread Vincent Pelletier
On Wed, 15 Aug 2018 10:19:14 +, Vincent Pelletier wrote: > Fixes a use-after-free reported by KASAN when later > iscsi_target_login_sess_out gets called and it tries to access > conn->sess->se_sess: I could still hit this issue by causing a timeout, and located the guilty kfree: > ret