|
@@ -278,6 +278,14 @@ static int target_xcopy_parse_segdesc_02(struct se_cmd *se_cmd, struct xcopy_op
|
|
|
|
|
|
xop->stdi = get_unaligned_be16(&desc[4]);
|
|
|
xop->dtdi = get_unaligned_be16(&desc[6]);
|
|
|
+
|
|
|
+ if (xop->stdi > XCOPY_CSCD_DESC_ID_LIST_OFF_MAX ||
|
|
|
+ xop->dtdi > XCOPY_CSCD_DESC_ID_LIST_OFF_MAX) {
|
|
|
+ pr_err("XCOPY segment desc 0x02: unsupported CSCD ID > 0x%x; stdi: %hu dtdi: %hu\n",
|
|
|
+ XCOPY_CSCD_DESC_ID_LIST_OFF_MAX, xop->stdi, xop->dtdi);
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
pr_debug("XCOPY seg desc 0x02: desc_len: %hu stdi: %hu dtdi: %hu, DC: %d\n",
|
|
|
desc_len, xop->stdi, xop->dtdi, dc);
|
|
|
|