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

[Xen-changelog] [qemu-xen stable-4.5] scsi: initialise info object with appropriate size



commit b402c283d4edc25d8eafae95329cea38a5b305f9
Author:     P J P <ppandit@xxxxxxxxxx>
AuthorDate: Mon Dec 21 15:13:13 2015 +0530
Commit:     Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
CommitDate: Fri Feb 5 14:55:01 2016 +0000

    scsi: initialise info object with appropriate size
    
    While processing controller 'CTRL_GET_INFO' command, the routine
    'megasas_ctrl_get_info' overflows the '&info' object size. Use its
    appropriate size to null initialise it.
    
    Reported-by: Qinghao Tang <luodalongde@xxxxxxxxx>
    Signed-off-by: Prasad J Pandit <pjp@xxxxxxxxxxxxxxxxx>
    Message-Id: <alpine.LFD.2.20.1512211501420.22471@wniryva>
    Cc: qemu-stable@xxxxxxxxxx
    Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
    Signed-off-by: P J P <ppandit@xxxxxxxxxx>
---
 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 1781525..e7a4d9f 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -676,7 +676,7 @@ static int megasas_ctrl_get_info(MegasasState *s, 
MegasasCmd *cmd)
     int num_ld_disks = 0;
     uint16_t sdev_id;
 
-    memset(&info, 0x0, cmd->iov_size);
+    memset(&info, 0x0, dcmd_size);
     if (cmd->iov_size < dcmd_size) {
         trace_megasas_dcmd_invalid_xfer_len(cmd->index, cmd->iov_size,
                                             dcmd_size);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.5

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.