]> git.baikalelectronics.ru Git - kernel.git/commit
target: check for XCOPY parameter truncation
authorDavid Disseldorp <ddiss@suse.de>
Mon, 2 Jan 2017 17:04:08 +0000 (18:04 +0100)
committerBart Van Assche <bart.vanassche@sandisk.com>
Tue, 10 Jan 2017 16:41:27 +0000 (08:41 -0800)
commit28b61041aff2ce45fd13b51f9ddd45b7c625ffc2
treea3d8c3c7bccadd4b9ed6e16fd59ea1e7d69e249c
parent41af33549f9ee10bcda49ce8542a39ee98325e5d
target: check for XCOPY parameter truncation

Check for XCOPY header, CSCD descriptor and segment descriptor list
truncation, and respond accordingly.

SPC4r37 6.4.1 EXTENDED COPY(LID4) states (also applying to LID1 reqs):
  If the parameter list length causes truncation of the parameter list,
  then the copy manager shall transfer no data and shall terminate the
  EXTENDED COPY command with CHECK CONDITION status, with the sense key
  set to ILLEGAL REQUEST, and the additional sense code set to PARAMETER
  LIST LENGTH ERROR.

This behaviour can be tested using the libiscsi ExtendedCopy.ParamHdr
test.

Signed-off-by: David Disseldorp <ddiss@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
drivers/target/target_core_xcopy.c
drivers/target/target_core_xcopy.h