Commit 41bfe204 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Jim Harris
Browse files

iscsi: Sequence error of Data-out PDU when ERL=0



SPDK drops the connection when it observes any sequence error of
Data-out PDU when ERL = 0. This is too severe and change dropping
the connection to Reject response.

This issue was detected by libiscsi test suite.

Change-Id: Ic8f50ce55c4e73c8517f726e8cf0e4ff8a0953df
Signed-off-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/391158


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent d1da2476
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -4113,6 +4113,7 @@ static int spdk_iscsi_op_data(struct spdk_iscsi_conn *conn,
	int lun_i;
	int F_bit;
	int rc;
	int reject_reason = ISCSI_REASON_INVALID_PDU_FIELD;

	if (conn->sess->session_type == SESSION_TYPE_DISCOVERY) {
		SPDK_ERRLOG("ISCSI_OP_SCSI_DATAOUT not allowed in discovery session\n");
@@ -4151,7 +4152,8 @@ static int spdk_iscsi_op_data(struct spdk_iscsi_conn *conn,
		if (conn->sess->ErrorRecoveryLevel >= 1) {
			goto send_r2t_recovery_return;
		} else {
			return SPDK_ISCSI_CONNECTION_FATAL;
			reject_reason = ISCSI_REASON_PROTOCOL_ERROR;
			goto reject_return;
		}
	}

@@ -4224,7 +4226,7 @@ send_r2t_recovery_return:
	return rc;

reject_return:
	rc = spdk_iscsi_reject(conn, pdu, ISCSI_REASON_INVALID_PDU_FIELD);
	rc = spdk_iscsi_reject(conn, pdu, reject_reason);
	if (rc < 0) {
		SPDK_ERRLOG("iscsi_reject() failed\n");
		return SPDK_ISCSI_CONNECTION_FATAL;