aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2013-11-13 17:33:24 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2013-11-13 17:33:24 -0500
commit122f8afcfb3fa77d05e934182242933ac60746cb (patch)
tree23e7d142f4215a04a14ee1a85e97fef99c7622f1 /drivers/target
parent04d9cd1224e5bc9d6146bab2866cdc81deb9b509 (diff)
iscsi-target: Reject unsupported multi PDU text command sequence
This patch adds a check to reject text commands with F_BIT=0 || C_BIT=1, as multi PDU text command sequences are currently unsupported. This avoids the case where a text command received with F_BIT=0, was generating a text response with F_BIT=1 which is a protocol error according to RFC-3720 Section 10.11.1. Reported-by: Arshad Hussain <arshad.hussain@calsoftinc.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/iscsi/iscsi_target.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index ab64cbbb4976..ba9787d24c12 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -1948,6 +1948,13 @@ iscsit_setup_text_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
1948 (unsigned char *)hdr); 1948 (unsigned char *)hdr);
1949 } 1949 }
1950 1950
1951 if (!(hdr->flags & ISCSI_FLAG_CMD_FINAL) ||
1952 (hdr->flags & ISCSI_FLAG_TEXT_CONTINUE)) {
1953 pr_err("Multi sequence text commands currently not supported\n");
1954 return iscsit_reject_cmd(cmd, ISCSI_REASON_CMD_NOT_SUPPORTED,
1955 (unsigned char *)hdr);
1956 }
1957
1951 pr_debug("Got Text Request: ITT: 0x%08x, CmdSN: 0x%08x," 1958 pr_debug("Got Text Request: ITT: 0x%08x, CmdSN: 0x%08x,"
1952 " ExpStatSN: 0x%08x, Length: %u\n", hdr->itt, hdr->cmdsn, 1959 " ExpStatSN: 0x%08x, Length: %u\n", hdr->itt, hdr->cmdsn,
1953 hdr->exp_statsn, payload_length); 1960 hdr->exp_statsn, payload_length);