소스 검색

target: check DPO/FUA usage for COMPARE AND WRITE

COMPARE AND WRITE requests should fail if DPO or FUA is set, but the
device is not advertising support.

Signed-off-by: David Disseldorp <ddiss@suse.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
David Disseldorp 10 년 전
부모
커밋
ab81a5e066
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      drivers/target/target_core_sbc.c

+ 3 - 0
drivers/target/target_core_sbc.c

@@ -992,6 +992,9 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops)
 			       " than 1\n", sectors);
 			return TCM_INVALID_CDB_FIELD;
 		}
+		if (sbc_check_dpofua(dev, cmd, cdb))
+			return TCM_INVALID_CDB_FIELD;
+
 		/*
 		 * Double size because we have two buffers, note that
 		 * zero is not an error..