summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorPrasad J Pandit2016-05-25 12:31:29 +0200
committerPaolo Bonzini2016-05-29 09:11:10 +0200
commit1b85898025c4cd95dce673d15e67e60e98e91731 (patch)
tree46a332a36be75dca822a5097f3305dc1bc4ec944 /hw
parentscsi: mptsas: infinite loop while fetching requests (diff)
downloadqemu-1b85898025c4cd95dce673d15e67e60e98e91731.tar.gz
qemu-1b85898025c4cd95dce673d15e67e60e98e91731.tar.xz
qemu-1b85898025c4cd95dce673d15e67e60e98e91731.zip
scsi: megasas: use appropriate property buffer size
When setting MegaRAID SAS controller properties via MegaRAID Firmware Interface(MFI) commands, a user supplied size parameter is used to set property value. Use appropriate size value to avoid OOB access issues. Reported-by: Li Qiang <liqiang6-s@360.cn> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> Message-Id: <1464172291-2856-2-git-send-email-ppandit@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/scsi/megasas.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index a63a581550..dcbd3e1f24 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -1446,7 +1446,7 @@ static int megasas_dcmd_set_properties(MegasasState *s, MegasasCmd *cmd)
dcmd_size);
return MFI_STAT_INVALID_PARAMETER;
}
- dma_buf_write((uint8_t *)&info, cmd->iov_size, &cmd->qsg);
+ dma_buf_write((uint8_t *)&info, dcmd_size, &cmd->qsg);
trace_megasas_dcmd_unsupported(cmd->index, cmd->iov_size);
return MFI_STAT_OK;
}