Spdk/lib/iscsi
Shuhei Matsumoto f918384212 iscsi: Return if conn->sock is NULL when updating connection params
iSCSI connection closes its socket when it is terminated. After the
socket is closed, the connection cannot access to it. However, the iSCSI
fuzz test terminated a connection while processing a text command. The
connection aborted the text command and the corresponding completion
callback accessed the closed socket. This unexpected access caused a
NULL pointer access.

Add a check if conn->sock is not NULL to iscsi_conn_params_update()
to avoid such NULL pointer access. The return type of the most iSCSI
library functions are void. Here, it is enough not to return 0. Hence,
use -ENXIO simply to indicate there is no available socket.

Fixes the issue #2958

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I2c1f58a63ee0a40561a17f81d4b4264061f411f6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17353
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Michal Berger <michal.berger@intel.com>
2023-05-09 17:58:11 +08:00
..
conn.c iscsi: add EXITING conns to pg after full_feature_migrate 2022-12-23 09:27:48 +00:00
conn.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
init_grp.c update Intel copyright notices 2022-11-10 08:28:53 +00:00
init_grp.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
iscsi_rpc.c iscsi: Use error_response() rather than bool_response(false) for JSON RPC 2023-01-31 21:40:09 +00:00
iscsi_subsystem.c update Intel copyright notices 2022-11-10 08:28:53 +00:00
iscsi.c iscsi: Return if conn->sock is NULL when updating connection params 2023-05-09 17:58:11 +08:00
iscsi.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
Makefile so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
md5.c update Intel copyright notices 2022-11-10 08:28:53 +00:00
md5.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
param.c lib/iscsi: missing a comma for the string 2022-12-20 09:20:31 +00:00
param.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
portal_grp.c freebsd: return negated error from getaddrinfo() 2023-03-10 16:44:37 +00:00
portal_grp.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
spdk_iscsi.map subsystem/iscsi: remove legacy config support 2020-10-20 08:53:53 +00:00
task.c update Intel copyright notices 2022-11-10 08:28:53 +00:00
task.h update Intel copyright notices 2022-11-10 08:28:53 +00:00
tgt_node.c update Intel copyright notices 2022-11-10 08:28:53 +00:00
tgt_node.h update Intel copyright notices 2022-11-10 08:28:53 +00:00