提交 275fd7d1 编写于 作者: M Mike Christie 提交者: James Bottomley

[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: NMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
上级 b6c395ed
...@@ -486,6 +486,8 @@ iscsi_tcp_hdr_recv(struct iscsi_conn *conn) ...@@ -486,6 +486,8 @@ iscsi_tcp_hdr_recv(struct iscsi_conn *conn)
case ISCSI_OP_SCSI_DATA_IN: case ISCSI_OP_SCSI_DATA_IN:
tcp_conn->in.ctask = session->cmds[itt]; tcp_conn->in.ctask = session->cmds[itt];
rc = iscsi_data_rsp(conn, tcp_conn->in.ctask); rc = iscsi_data_rsp(conn, tcp_conn->in.ctask);
if (rc)
return rc;
/* fall through */ /* fall through */
case ISCSI_OP_SCSI_CMD_RSP: case ISCSI_OP_SCSI_CMD_RSP:
tcp_conn->in.ctask = session->cmds[itt]; tcp_conn->in.ctask = session->cmds[itt];
...@@ -532,7 +534,7 @@ iscsi_tcp_hdr_recv(struct iscsi_conn *conn) ...@@ -532,7 +534,7 @@ iscsi_tcp_hdr_recv(struct iscsi_conn *conn)
* skbs to complete the command then we have to copy the header * skbs to complete the command then we have to copy the header
* for later use * 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 + (tcp_conn->in.datalen + tcp_conn->in.padding +
(conn->datadgst_en ? 4 : 0))) { (conn->datadgst_en ? 4 : 0))) {
debug_tcp("Copying header for later use. in.copy %d in.datalen" debug_tcp("Copying header for later use. in.copy %d in.datalen"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册