Re: [PATCH] scsi: iscsi_tcp: Check the sock is correct before iscsi_set_param

From: Mike Christie
Date: Wed Mar 29 2023 - 11:17:47 EST


On 3/29/23 2:17 AM, Zhong Jinghua wrote:
> From: Zhong Jinghua <zhongjinghua@xxxxxxxxxx>
>
> The correctness of sock should be checked before assignment to avoid
> assigning wrong values.
>
> Commit
> "scsi: iscsi: iscsi_tcp: Fix null-ptr-deref while calling getpeername()"
> introduced this change. This change may lead to inconsistent values of
> tcp_sw_conn->sendpage and conn->datadgst_en.
>
> Fix it by moving the position of the assignment.
>
> Fixes: 57569c37f0ad ("scsi: iscsi: iscsi_tcp: Fix null-ptr-deref while calling getpeername()")
> Signed-off-by: Zhong Jinghua <zhongjinghua@xxxxxxxxxx>

Thanks.

Reviewed-by: Mike Christie <michael.christie@xxxxxxxxxx>