Commit 7895a746 authored by Elena Reshetova's avatar Elena Reshetova Committed by Kleber Sacilotto de Souza

qla2xxx: prevent speculative execution

CVE-2017-5753 (Spectre v1 Intel)

Since the handle value in functions qlafx00_status_entry()
and qlafx00_multistatus_entry() seems to be controllable
by userspace and later on conditionally (upon bound check)
used to resolve req->outstanding_cmds, insert an observable
speculation barrier before its usage. This should prevent
observable speculation on that branch and avoid kernel
memory leak.
Signed-off-by: default avatarElena Reshetova <elena.reshetova@intel.com>
Signed-off-by: default avatarAndy Whitcroft <apw@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 8e8527e8
......@@ -2302,10 +2302,12 @@ qlafx00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
req = ha->req_q_map[que];
/* Validate handle. */
if (handle < req->num_outstanding_cmds)
if (handle < req->num_outstanding_cmds) {
osb();
sp = req->outstanding_cmds[handle];
else
} else {
sp = NULL;
}
if (sp == NULL) {
ql_dbg(ql_dbg_io, vha, 0x3034,
......@@ -2653,10 +2655,12 @@ qlafx00_multistatus_entry(struct scsi_qla_host *vha,
req = ha->req_q_map[que];
/* Validate handle. */
if (handle < req->num_outstanding_cmds)
if (handle < req->num_outstanding_cmds) {
osb();
sp = req->outstanding_cmds[handle];
else
} else {
sp = NULL;
}
if (sp == NULL) {
ql_dbg(ql_dbg_io, vha, 0x3044,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment