[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/3] scsi: megasas: use appropriate property buf

From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH 1/3] scsi: megasas: use appropriate property buffer size
Date: Wed, 25 May 2016 13:06:36 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 05/25/2016 12:31 PM, P J P wrote:
From: Prasad J Pandit <address@hidden>

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 <address@hidden>
Signed-off-by: Prasad J Pandit <address@hidden>
  hw/scsi/megasas.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index a63a581..dcbd3e1 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)
-    dma_buf_write((uint8_t *)&info, cmd->iov_size, &cmd->qsg);
+    dma_buf_write((uint8_t *)&info, dcmd_size, &cmd->qsg);

This looks odd - can dcmd_size be bigger than iov_size? Wouldn't we overwrite guest memory then? And where does dcmd_size come from? I don't see it in master.


      trace_megasas_dcmd_unsupported(cmd->index, cmd->iov_size);
      return MFI_STAT_OK;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]