target: Re-add check to reject control WRITEs with overflow data
authorNicholas Bellinger <nab@linux-iscsi.org>
Thu, 11 May 2017 08:07:24 +0000 (01:07 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Tue, 16 May 2017 03:20:29 +0000 (20:20 -0700)
commit4ff83daa0200affe1894bd33d17bac404e3d78d4
treec44aa18cfe4c9f274206ec9460b34083b3a727d9
parent75dbf2d36f6b122ad3c1070fe4bf95f71bbff321
target: Re-add check to reject control WRITEs with overflow data

During v4.3 when the overflow/underflow check was relaxed by
commit c72c525022:

  commit c72c5250224d475614a00c1d7e54a67f77cd3410
  Author: Roland Dreier <roland@purestorage.com>
  Date:   Wed Jul 22 15:08:18 2015 -0700

       target: allow underflow/overflow for PR OUT etc. commands

to allow underflow/overflow for Windows compliance + FCP, a
consequence was to allow control CDBs to process overflow
data for iscsi-target with immediate data as well.

As per Roland's original change, continue to allow underflow
cases for control CDBs to make Windows compliance + FCP happy,
but until overflow for control CDBs is supported tree-wide,
explicitly reject all control WRITEs with overflow following
pre v4.3.y logic.

Reported-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Roland Dreier <roland@purestorage.com>
Cc: <stable@vger.kernel.org> # v4.3+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_transport.c