提交 36008cf1 编写于 作者: C Chad Dupuis 提交者: James Bottomley

[SCSI] qla2xxx: Fix request queue null dereference.

If an invalid IOCB is returned on the response queue then the index into the
request queue map could be invalid and could return to us a bogus value. This
could cause us to try to deference an invalid pointer and cause an exception.

If we encounter this condition, simply return as no context can be established
for this response.
Signed-off-by: NChad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: NSaurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
上级 6541932e
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* | Device Discovery | 0x2095 | 0x2020-0x2022, | * | Device Discovery | 0x2095 | 0x2020-0x2022, |
* | | | 0x2011-0x2012, | * | | | 0x2011-0x2012, |
* | | | 0x2016 | * | | | 0x2016 |
* | Queue Command and IO tracing | 0x3058 | 0x3006-0x300b | * | Queue Command and IO tracing | 0x3059 | 0x3006-0x300b |
* | | | 0x3027-0x3028 | * | | | 0x3027-0x3028 |
* | | | 0x303d-0x3041 | * | | | 0x303d-0x3041 |
* | | | 0x302d,0x3033 | * | | | 0x302d,0x3033 |
......
...@@ -1957,6 +1957,15 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt) ...@@ -1957,6 +1957,15 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
que = MSW(sts->handle); que = MSW(sts->handle);
req = ha->req_q_map[que]; req = ha->req_q_map[que];
/* Check for invalid queue pointer */
if (req == NULL ||
que >= find_first_zero_bit(ha->req_qid_map, ha->max_req_queues)) {
ql_dbg(ql_dbg_io, vha, 0x3059,
"Invalid status handle (0x%x): Bad req pointer. req=%p, "
"que=%u.\n", sts->handle, req, que);
return;
}
/* Validate handle. */ /* Validate handle. */
if (handle < req->num_outstanding_cmds) if (handle < req->num_outstanding_cmds)
sp = req->outstanding_cmds[handle]; sp = req->outstanding_cmds[handle];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册