From: Nicholas Bellinger Date: Fri, 20 Jun 2014 17:59:57 +0000 (-0700) Subject: iscsi-target: Avoid rejecting incorrect ITT for Data-Out X-Git-Tag: v3.14.11~56 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7147221ab031654da334621273e88baaabcc4d03;p=platform%2Fkernel%2Flinux-stable.git iscsi-target: Avoid rejecting incorrect ITT for Data-Out commit 97c99b47ac58bacb7c09e1f47d5d184434f6b06a upstream. This patch changes iscsit_check_dataout_hdr() to dump the incoming Data-Out payload when the received ITT is not associated with a WRITE, instead of calling iscsit_reject_cmd() for the non WRITE ITT descriptor. This addresses a bug where an initiator sending an Data-Out for an ITT associated with a READ would end up generating a reject for the READ, eventually resulting in list corruption. Reported-by: Santosh Kulkarni Reported-by: Arshad Hussain Signed-off-by: Nicholas Bellinger Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index 22601c7..f329ad2 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -1290,7 +1290,7 @@ iscsit_check_dataout_hdr(struct iscsi_conn *conn, unsigned char *buf, if (cmd->data_direction != DMA_TO_DEVICE) { pr_err("Command ITT: 0x%08x received DataOUT for a" " NON-WRITE command.\n", cmd->init_task_tag); - return iscsit_reject_cmd(cmd, ISCSI_REASON_PROTOCOL_ERROR, buf); + return iscsit_dump_data_payload(conn, payload_length, 1); } se_cmd = &cmd->se_cmd; iscsit_mod_dataout_timer(cmd);