[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] virtio-gpu: check if the resource already exist
From: |
Michael Tokarev |
Subject: |
Re: [Qemu-devel] [PATCH] virtio-gpu: check if the resource already exists in virtio_gpu_load() |
Date: |
Mon, 26 Aug 2019 18:58:13 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 |
28.06.2019 19:13, Li Qiang wrote:
> While loading virtio-gpu, the data can be malicious, we
> should check if the resource already exists.
>
> Signed-off-by: Li Qiang <address@hidden>
> ---
> hw/display/virtio-gpu.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
> index 2b0f66b1d6..f1ebed9959 100644
> --- a/hw/display/virtio-gpu.c
> +++ b/hw/display/virtio-gpu.c
> @@ -1002,6 +1002,11 @@ static int virtio_gpu_load(QEMUFile *f, void *opaque,
> size_t size,
>
> resource_id = qemu_get_be32(f);
> while (resource_id != 0) {
> + res = virtio_gpu_find_resource(g, resource_id);
> + if (res) {
> + return -EINVAL;
EEXIST?
/mjt
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH] virtio-gpu: check if the resource already exists in virtio_gpu_load(),
Michael Tokarev <=