Skip to content

Commit

Permalink
[SCSI] iscsi_tcp: drop session when itt does not match any command
Browse files Browse the repository at this point in the history
A target should never send us a itt that does not match a running
task. If it does we do not really know what is coming down after the header,
unless we evaluate the hdr and do some guessing sometimes. However,
even if we know what is coming we probably do not have buffers for it or we
cannot respond (if it is a r2t for example), so just drop the session.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
  • Loading branch information
Mike Christie authored and James Bottomley committed Jan 12, 2008
1 parent 03766a1 commit 7a53dc5
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drivers/scsi/iscsi_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,11 +755,7 @@ iscsi_tcp_hdr_dissect(struct iscsi_conn *conn, struct iscsi_hdr *hdr)
opcode = hdr->opcode & ISCSI_OPCODE_MASK;
/* verify itt (itt encoding: age+cid+itt) */
rc = iscsi_verify_itt(conn, hdr, &itt);
if (rc == ISCSI_ERR_NO_SCSI_CMD) {
/* XXX: what does this do? */
tcp_conn->in.datalen = 0; /* force drop */
return 0;
} else if (rc)
if (rc)
return rc;

debug_tcp("opcode 0x%x ahslen %d datalen %d\n",
Expand Down

0 comments on commit 7a53dc5

Please sign in to comment.