Message ID | 1494481655.16894.148.camel@haakon3.risingtidesystems.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Wed, 2017-05-10 at 22:47 -0700, Nicholas A. Bellinger wrote: > On Wed, 2017-05-10 at 13:37 -0700, Bart Van Assche wrote: > > Hello Nic, > > > > As you requested I have rebased this patch series on top of the for-next > > branch of your target-pending git repository and I have left out those > > patches that are not bug fixes. Please consider these patches for kernel > > v4.12. > > No, I'm not going to merge a bunch of changes at the last minute to > avoid a regression for something your patch exposed in for-next. > > If you're able to trigger a issue outside of WRITE_VERIFY with > iscsi-target for target-pending/for-next, then we should make a change > to Roland's commit c72c525022 in >= v4.3.y to do the following. > > diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c > index 37f5735..b20acc8 100644 > --- a/drivers/target/target_core_transport.c > +++ b/drivers/target/target_core_transport.c > @@ -1165,10 +1165,16 @@ int transport_dump_vpd_ident( > " 0x%02x\n", cmd->se_tfo->get_fabric_name(), > cmd->data_length, size, cmd->t_task_cdb[0]); > > - if (cmd->data_direction == DMA_TO_DEVICE && > - cmd->se_cmd_flags & SCF_SCSI_DATA_CDB) { > - pr_err("Rejecting underflow/overflow WRITE data\n"); > + if (cmd->data_direction == DMA_TO_DEVICE) { > + > + if (cmd->se_cmd_flags & SCF_SCSI_DATA_CDB) { > + pr_err("Rejecting underflow/overflow WRITE SCSI_DATA_CDB\n"); > + return TCM_INVALID_CDB_FIELD; > + } > + if (size > cmd->data_length) { > + pr_err("Rejecting overflow for WRITE CDB\n"); > return TCM_INVALID_CDB_FIELD; > + } > } > /* > * Reject READ_* or WRITE_* with overflow/underflow for > > Otherwise if you want to actually support WRITE overflow, you're more > than welcome to pursue that for v4.13-rc1, but I'm not going to make a > merge a bunch of changes at the last minute of a merge window. Hi Bart, If you're unable to live with the minor patch to address your regression wrt WRITE_VERIFY overflow operation in -rc1, then I'll go ahead and push the revert here: https://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git/commit/?h=for-next&id=69be17042db730092d25691dd85868a41d4d99ac I'll be sending out a PULL request for -rc1 tomorrow, so feel free to let me know if you'd like to avoid this revert and still get your patch in, or not. Right now I'm planning to just revert it. For v4.12-rc, I'll be including the earlier target_cmd_size_check() patch to address breakage in Roland's change introduced in v4.3.y, and disallow WRITE overflow for all cases. For v4.13-rc1 and beyond, you are more than welcome to post patches to support WRITE overflow handling, but since your patches are not a regression bug-fix (but rather new functionality) they are not v4.12-rc material. -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, 2017-05-10 at 23:46 -0700, Nicholas A. Bellinger wrote: > then I'll go ahead and push the revert here: > > https://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git/commit/?h=for-next&id=69be17042db730092d25691dd85868a41d4d99ac Hello Nic, As you know any patch that is sent to Linus should be posted on the appropriate mailing list first. Posting an URL to a patch is not sufficient. Bart.-- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 37f5735..b20acc8 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1165,10 +1165,16 @@ int transport_dump_vpd_ident( " 0x%02x\n", cmd->se_tfo->get_fabric_name(), cmd->data_length, size, cmd->t_task_cdb[0]); - if (cmd->data_direction == DMA_TO_DEVICE && - cmd->se_cmd_flags & SCF_SCSI_DATA_CDB) { - pr_err("Rejecting underflow/overflow WRITE data\n"); + if (cmd->data_direction == DMA_TO_DEVICE) { + + if (cmd->se_cmd_flags & SCF_SCSI_DATA_CDB) { + pr_err("Rejecting underflow/overflow WRITE SCSI_DATA_CDB\n"); + return TCM_INVALID_CDB_FIELD; + } + if (size > cmd->data_length) { + pr_err("Rejecting overflow for WRITE CDB\n"); return TCM_INVALID_CDB_FIELD; + } } /* * Reject READ_* or WRITE_* with overflow/underflow for