qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] vmw_pvscsi: check message ring page count at in


From: Dmitry Fleytman
Subject: Re: [Qemu-devel] [PATCH] vmw_pvscsi: check message ring page count at initialisation
Date: Tue, 25 Apr 2017 18:52:07 +0300

> On 25 Apr 2017, at 16:06 PM, P J P <address@hidden> wrote:
> 
> Vmware Paravirtual SCSI emulation uses command descriptors to
> process SCSI commands. These come with their message ring buffers.
> A guest could set the message ring page count to an arbitrary value
> resulting in infinite loop. Add check to avoid it.

Hello P J P,

Except the commit message that does not exactly correspond to what this patch 
does,

Reviewed-by: Dmitry Fleytman <address@hidden>


Thanks for the patch,
Dmitry.

> 
> Reported-by: YY Z <address@hidden>
> Signed-off-by: P J P <address@hidden>
> ---
> hw/scsi/vmw_pvscsi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c
> index 7557546..4a106da 100644
> --- a/hw/scsi/vmw_pvscsi.c
> +++ b/hw/scsi/vmw_pvscsi.c
> @@ -202,7 +202,7 @@ pvscsi_ring_init_msg(PVSCSIRingInfo *m, 
> PVSCSICmdDescSetupMsgRing *ri)
>     uint32_t len_log2;
>     uint32_t ring_size;
> 
> -    if (ri->numPages > PVSCSI_SETUP_MSG_RING_MAX_NUM_PAGES) {
> +    if (!ri->numPages || ri->numPages > PVSCSI_SETUP_MSG_RING_MAX_NUM_PAGES) 
> {
>         return -1;
>     }
>     ring_size = ri->numPages * PVSCSI_MAX_NUM_MSG_ENTRIES_PER_PAGE;
> -- 
> 2.9.3
> 



reply via email to

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