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

2017-07-13 Thread Bart Van Assche
On Thu, 2017-07-13 at 12:27 -0700, Nicholas A. Bellinger wrote: > For the former, I've still never seen a host environment in the wild > over the last 15 years that generates underflow/overflow for DATA CDBs > with an LBA. So I'm reluctant to randomly allow this for all cases and > fabrics,

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

2017-07-13 Thread Bart Van Assche
On Thu, 2017-07-13 at 12:27 -0700, Nicholas A. Bellinger wrote: > For the former, I've still never seen a host environment in the wild > over the last 15 years that generates underflow/overflow for DATA CDBs > with an LBA. So I'm reluctant to randomly allow this for all cases and > fabrics,

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

2017-07-13 Thread Nicholas A. Bellinger
On Tue, 2017-07-11 at 16:17 +, Bart Van Assche wrote: > On Tue, 2017-07-11 at 00:22 -0700, Nicholas A. Bellinger wrote: > > So rejecting this case as already done in commit abb85a9b51 is the > > correct approach for >= v4.3.y. > > Hello Nic, > > I hope that you agree that the current

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

2017-07-13 Thread Nicholas A. Bellinger
On Tue, 2017-07-11 at 16:17 +, Bart Van Assche wrote: > On Tue, 2017-07-11 at 00:22 -0700, Nicholas A. Bellinger wrote: > > So rejecting this case as already done in commit abb85a9b51 is the > > correct approach for >= v4.3.y. > > Hello Nic, > > I hope that you agree that the current

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

2017-07-11 Thread Bart Van Assche
On Tue, 2017-07-11 at 00:22 -0700, Nicholas A. Bellinger wrote: > So rejecting this case as already done in commit abb85a9b51 is the > correct approach for >= v4.3.y. Hello Nic, I hope that you agree that the current target_cmd_size_check() implementation is complicated and ugly. Patch 30/33 of

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

2017-07-11 Thread Bart Van Assche
On Tue, 2017-07-11 at 00:22 -0700, Nicholas A. Bellinger wrote: > So rejecting this case as already done in commit abb85a9b51 is the > correct approach for >= v4.3.y. Hello Nic, I hope that you agree that the current target_cmd_size_check() implementation is complicated and ugly. Patch 30/33 of

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

2017-07-11 Thread Nicholas A. Bellinger
Hi Bart, On Thu, 2017-06-08 at 23:55 -0700, Nicholas A. Bellinger wrote: > On Thu, 2017-06-08 at 15:37 +, Bart Van Assche wrote: > > On Thu, 2017-06-08 at 04:21 +, Nicholas A. Bellinger wrote: > > > + /* > > > + * Check for underflow case where both EDTL and immediate data payload > > >

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

2017-07-11 Thread Nicholas A. Bellinger
Hi Bart, On Thu, 2017-06-08 at 23:55 -0700, Nicholas A. Bellinger wrote: > On Thu, 2017-06-08 at 15:37 +, Bart Van Assche wrote: > > On Thu, 2017-06-08 at 04:21 +, Nicholas A. Bellinger wrote: > > > + /* > > > + * Check for underflow case where both EDTL and immediate data payload > > >

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

2017-06-09 Thread Nicholas A. Bellinger
On Thu, 2017-06-08 at 15:37 +, Bart Van Assche wrote: > On Thu, 2017-06-08 at 04:21 +, 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 > > +

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

2017-06-09 Thread Nicholas A. Bellinger
On Thu, 2017-06-08 at 15:37 +, Bart Van Assche wrote: > On Thu, 2017-06-08 at 04:21 +, 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 > > +

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

2017-06-08 Thread Bart Van Assche
On Thu, 2017-06-08 at 04:21 +, 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

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

2017-06-08 Thread Bart Van Assche
On Thu, 2017-06-08 at 04:21 +, 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

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

2017-06-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger When iscsi WRITE underflow occurs there are two different scenarios that can happen. Normally in practice, when an EDTL vs. SCSI CDB TRANSFER LENGTH underflow is detected, the iscsi immediate data payload is the smaller SCSI CDB TRANSFER LENGTH.

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

2017-06-07 Thread Nicholas A. Bellinger
From: Nicholas Bellinger When iscsi WRITE underflow occurs there are two different scenarios that can happen. Normally in practice, when an EDTL vs. SCSI CDB TRANSFER LENGTH underflow is detected, the iscsi immediate data payload is the smaller SCSI CDB TRANSFER LENGTH. That is, when a host