Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1661410

Re: [PATCH] iscsi-target: Reject immediate data underflow larger than SCSI transfer length

From Bart Van Assche <Bart.VanAssche@sandisk.com>
Newsgroups linux.kernel
Subject Re: [PATCH] iscsi-target: Reject immediate data underflow larger than SCSI transfer length
Date 2017-06-08 17:50 +0200
Message-ID <tQ7R7-66J-5@gated-at.bofh.it> (permalink)
References <tPX5o-7J4-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, 2017-06-08 at 04:21 +0000, Nicholas A. Bellinger wrote:
> +	/*
> +	 * Check for underflow case where both EDTL and immediate data payload
> +	 * exceeds what is presented by CDB's TRANSFER LENGTH, and what has
> +	 * already been set in target_cmd_size_check() as se_cmd->data_length.
> +	 *
> +	 * For this special case, fail the command and dump the immediate data
> +	 * payload.
> +	 */
> +	if (cmd->first_burst_len > cmd->se_cmd.data_length) {
> +		cmd->sense_reason = TCM_INVALID_CDB_FIELD;
> +		goto after_immediate_data;
> +	}

A quote from the iSCSI RFC (https://tools.ietf.org/html/rfc5048):

   If SPDTL < EDTL for a task, iSCSI Underflow MUST be signaled in the
   SCSI Response PDU as specified in [RFC3720].  The Residual Count MUST
   be set to the numerical value of (EDTL - SPDTL).

Sorry but I don't think that sending TCM_INVALID_CDB_FIELD back to the
initiator is compliant with the iSCSI RFC. Please note that a fix that is
compliant with the iSCSI RFC is present in the following patch series: [PATCH
00/33] SCSI target driver patches for kernel v4.13, 23 May 2017
(https://www.spinics.net/lists/target-devel/msg15370.html).

Bart.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] iscsi-target: Reject immediate data underflow larger than SCSI transfer length "Nicholas A. Bellinger" <nab@linux-iscsi.org> - 2017-06-08 06:20 +0200
  Re: [PATCH] iscsi-target: Reject immediate data underflow larger than  SCSI transfer length Bart Van Assche <Bart.VanAssche@sandisk.com> - 2017-06-08 17:50 +0200
    Re: [PATCH] iscsi-target: Reject immediate data underflow larger  than SCSI transfer length "Nicholas A. Bellinger" <nab@linux-iscsi.org> - 2017-06-09 09:00 +0200

csiph-web