[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [PULL 2/4] virtio-gpu: check if the resource already exists i
From: |
Gerd Hoffmann |
Subject: |
[Qemu-arm] [PULL 2/4] virtio-gpu: check if the resource already exists in virtio_gpu_load() |
Date: |
Wed, 3 Jul 2019 10:54:14 +0200 |
From: Li Qiang <address@hidden>
While loading virtio-gpu, the data can be malicious, we
should check if the resource already exists.
Signed-off-by: Li Qiang <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <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 475a018c027c..25d9e327fc69 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;
+ }
+
res = g_new0(struct virtio_gpu_simple_resource, 1);
res->resource_id = resource_id;
res->width = qemu_get_be32(f);
--
2.18.1
- [Qemu-arm] [PULL 0/4] Vga 20190703 patches, Gerd Hoffmann, 2019/07/03
- [Qemu-arm] [PULL 3/4] hw/i2c/bitbang_i2c: Use in-place rather than malloc'd bitbang_i2c_interface struct, Gerd Hoffmann, 2019/07/03
- [Qemu-arm] [PULL 2/4] virtio-gpu: check if the resource already exists in virtio_gpu_load(),
Gerd Hoffmann <=
- [Qemu-arm] [PULL 1/4] virtio-gpu: fix unmap in error path, Gerd Hoffmann, 2019/07/03
- [Qemu-arm] [PULL 4/4] Add ati vgabios to INSTALL_BLOBS., Gerd Hoffmann, 2019/07/03
- Re: [Qemu-arm] [PULL 0/4] Vga 20190703 patches, Peter Maydell, 2019/07/04
- Re: [Qemu-arm] [Qemu-devel] [PULL 0/4] Vga 20190703 patches, no-reply, 2019/07/04
- Re: [Qemu-arm] [Qemu-devel] [PULL 0/4] Vga 20190703 patches, no-reply, 2019/07/04
- Re: [Qemu-arm] [Qemu-devel] [PULL 0/4] Vga 20190703 patches, no-reply, 2019/07/04