iscsi-target: Reject unsupported multi PDU text command sequence

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Nov 22 17:59:09 EST 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=122f8afcfb3fa77d05e934182242933ac60746cb
Commit:     122f8afcfb3fa77d05e934182242933ac60746cb
Parent:     04d9cd1224e5bc9d6146bab2866cdc81deb9b509
Author:     Nicholas Bellinger <nab at linux-iscsi.org>
AuthorDate: Wed Nov 13 14:33:24 2013 -0800
Committer:  Nicholas Bellinger <nab at linux-iscsi.org>
CommitDate: Wed Nov 13 14:33:24 2013 -0800

    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 at calsoftinc.com>
    Signed-off-by: Nicholas Bellinger <nab at linux-iscsi.org>
---
 drivers/target/iscsi/iscsi_target.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index ab64cbb..ba9787d 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,
 					 (unsigned char *)hdr);
 	}
 
+	if (!(hdr->flags & ISCSI_FLAG_CMD_FINAL) ||
+	     (hdr->flags & ISCSI_FLAG_TEXT_CONTINUE)) {
+		pr_err("Multi sequence text commands currently not supported\n");
+		return iscsit_reject_cmd(cmd, ISCSI_REASON_CMD_NOT_SUPPORTED,
+					(unsigned char *)hdr);
+	}
+
 	pr_debug("Got Text Request: ITT: 0x%08x, CmdSN: 0x%08x,"
 		" ExpStatSN: 0x%08x, Length: %u\n", hdr->itt, hdr->cmdsn,
 		hdr->exp_statsn, payload_length);



More information about the linux-mtd-cvs mailing list