[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] virtio-gpu: add sanity check
From: |
Marc-André Lureau |
Subject: |
Re: [Qemu-devel] [PATCH] virtio-gpu: add sanity check |
Date: |
Mon, 27 May 2019 12:49:00 +0200 |
On Mon, May 27, 2019 at 11:13 AM Gerd Hoffmann <address@hidden> wrote:
>
> Require a minimum 16x16 size for the scanout, to make sure the guest
> can't set either width or height to zero. This (a) doesn't make sense
> at all and (b) causes problems in some UI code. When using spice this
> will triggers an assert().
>
> Reported-by: Tyler Slabinski <address@hidden>
> Signed-off-by: Gerd Hoffmann <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
> ---
> hw/display/virtio-gpu.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
> index 9e37e0ac96b7..372b31ef0af2 100644
> --- a/hw/display/virtio-gpu.c
> +++ b/hw/display/virtio-gpu.c
> @@ -677,6 +677,8 @@ static void virtio_gpu_set_scanout(VirtIOGPU *g,
>
> if (ss.r.x > res->width ||
> ss.r.y > res->height ||
> + ss.r.width < 16 ||
> + ss.r.height < 16 ||
> ss.r.width > res->width ||
> ss.r.height > res->height ||
> ss.r.x + ss.r.width > res->width ||
> --
> 2.18.1
>
>
--
Marc-André Lureau