Re: [PATCH 1/2] iscsi_tcp: Fix NULL pointer dereference in iscsi_sw_tcp_conn_get_param()

2022-03-03 Thread 'Wenchao Hao' via open-iscsi
On 2022/3/3 23:03, Mike Christie wrote: On 3/3/22 8:56 PM, Wenchao Hao wrote: kernel might crash in iscsi_sw_tcp_conn_get_param() because it dereference an invalid address. The initialization of iscsi_conn's dd_data is after device_register() of struct iscsi_cls_conn, so iscsi_conn's dd_data

Re: [PATCH 2/2] iscsi_tcp: Check if tcp_conn is valid in

2022-03-03 Thread 'Wenchao Hao' via open-iscsi
On 2022/3/3 22:59, Mike Christie wrote: On 3/3/22 8:56 PM, Wenchao Hao wrote: iscsi_create_conn() would add newly alloced iscsi_cls_conn to connlist, it means when userspace sends ISCSI_UEVENT_SET_PARAM, iscsi_conn_lookup() would found this iscsi_cls_conn and call the set_param callback which

Re: [PATCH 1/2] iscsi_tcp: Fix NULL pointer dereference in iscsi_sw_tcp_conn_get_param()

2022-03-03 Thread Mike Christie
On 3/3/22 8:56 PM, Wenchao Hao wrote: > kernel might crash in iscsi_sw_tcp_conn_get_param() because it dereference > an invalid address. > > The initialization of iscsi_conn's dd_data is after device_register() of > struct iscsi_cls_conn, so iscsi_conn's dd_data might not initialized when >

Re: [PATCH 2/2] iscsi_tcp: Check if tcp_conn is valid in

2022-03-03 Thread Mike Christie
On 3/3/22 8:56 PM, Wenchao Hao wrote: > iscsi_create_conn() would add newly alloced iscsi_cls_conn to connlist, > it means when userspace sends ISCSI_UEVENT_SET_PARAM, iscsi_conn_lookup() > would found this iscsi_cls_conn and call the set_param callback which is > iscsi_sw_tcp_conn_set_param().

[PATCH 2/2] iscsi_tcp: Check if tcp_conn is valid in

2022-03-03 Thread 'Wenchao Hao' via open-iscsi
iscsi_create_conn() would add newly alloced iscsi_cls_conn to connlist, it means when userspace sends ISCSI_UEVENT_SET_PARAM, iscsi_conn_lookup() would found this iscsi_cls_conn and call the set_param callback which is iscsi_sw_tcp_conn_set_param(). While the iscsi_conn's dd_data might not been

[PATCH 1/2] iscsi_tcp: Fix NULL pointer dereference in iscsi_sw_tcp_conn_get_param()

2022-03-03 Thread 'Wenchao Hao' via open-iscsi
kernel might crash in iscsi_sw_tcp_conn_get_param() because it dereference an invalid address. The initialization of iscsi_conn's dd_data is after device_register() of struct iscsi_cls_conn, so iscsi_conn's dd_data might not initialized when iscsi_sw_tcp_conn_get_param() is called. Following