diff options
author | Zhong Jinghua <zhongjinghua@huawei.com> | 2023-03-29 15:17:39 +0800 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2023-04-02 21:44:27 -0400 |
commit | 48b19b79cfa37b1e50da3b5a8af529f994c08901 (patch) | |
tree | 159562be9829d41d5ac34c954e49e2c5d940b1c3 /include | |
parent | 85ade4010e13ef152ea925c74d94253db92e5428 (diff) |
scsi: iscsi_tcp: Check that sock is valid before iscsi_set_param()
The validity of sock should be checked before assignment to avoid incorrect
values. Commit 57569c37f0ad ("scsi: iscsi: iscsi_tcp: Fix null-ptr-deref
while calling getpeername()") introduced this change which may lead to
inconsistent values of tcp_sw_conn->sendpage and conn->datadgst_en.
Fix the issue 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@huawei.com>
Link: https://lore.kernel.org/r/20230329071739.2175268-1-zhongjinghua@huaweicloud.com
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions