diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2006-07-24 15:47:17 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-07-28 11:48:01 -0500 |
commit | 275fd7d129fdd16d1dc0ec6a8d60bd6b72a76e31 (patch) | |
tree | e87776f201ceef9a53ec7c74ae65fe465d2e0829 /drivers/scsi/iscsi_tcp.c | |
parent | b6c395ed0387c824ddf125d3b74b576a2575c149 (diff) | |
download | kernel_samsung_smdk4412-275fd7d129fdd16d1dc0ec6a8d60bd6b72a76e31.zip kernel_samsung_smdk4412-275fd7d129fdd16d1dc0ec6a8d60bd6b72a76e31.tar.gz kernel_samsung_smdk4412-275fd7d129fdd16d1dc0ec6a8d60bd6b72a76e31.tar.bz2 |
[SCSI] iscsi bugfixes: handle data rsp errors
if iscsi_data_rsp fails we must bail out. Since the pdu values like
data length are invalid we cannot continue to process the data since
it could over run buffers.
This fixes a bug with cisco 5428s where that target is sending
too much data.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/iscsi_tcp.c')
-rw-r--r-- | drivers/scsi/iscsi_tcp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c index ab324d9..7d78459 100644 --- a/drivers/scsi/iscsi_tcp.c +++ b/drivers/scsi/iscsi_tcp.c @@ -486,6 +486,8 @@ iscsi_tcp_hdr_recv(struct iscsi_conn *conn) case ISCSI_OP_SCSI_DATA_IN: tcp_conn->in.ctask = session->cmds[itt]; rc = iscsi_data_rsp(conn, tcp_conn->in.ctask); + if (rc) + return rc; /* fall through */ case ISCSI_OP_SCSI_CMD_RSP: tcp_conn->in.ctask = session->cmds[itt]; @@ -532,7 +534,7 @@ copy_hdr: * skbs to complete the command then we have to copy the header * for later use */ - if (tcp_conn->in.zero_copy_hdr && tcp_conn->in.copy < + if (tcp_conn->in.zero_copy_hdr && tcp_conn->in.copy <= (tcp_conn->in.datalen + tcp_conn->in.padding + (conn->datadgst_en ? 4 : 0))) { debug_tcp("Copying header for later use. in.copy %d in.datalen" |