[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 1/5] virtio-gpu: fix information leak in capset get d
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PULL 1/5] virtio-gpu: fix information leak in capset get dispatch |
Date: |
Wed, 11 Jan 2017 11:28:33 +0100 |
From: Li Qiang <address@hidden>
In virgl_cmd_get_capset function, it uses g_malloc to allocate
a response struct to the guest. As the 'resp'struct hasn't been full
initialized it will lead the 'resp->padding' field to the guest.
Use g_malloc0 to avoid this.
Signed-off-by: Li Qiang <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Message-id: address@hidden
[ kraxel: resolved conflict ]
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/display/virtio-gpu-3d.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/display/virtio-gpu-3d.c b/hw/display/virtio-gpu-3d.c
index b13ced3..f96a0c2 100644
--- a/hw/display/virtio-gpu-3d.c
+++ b/hw/display/virtio-gpu-3d.c
@@ -379,7 +379,7 @@ static void virgl_cmd_get_capset(VirtIOGPU *g,
return;
}
- resp = g_malloc(sizeof(*resp) + max_size);
+ resp = g_malloc0(sizeof(*resp) + max_size);
resp->hdr.type = VIRTIO_GPU_RESP_OK_CAPSET;
virgl_renderer_fill_caps(gc.capset_id,
gc.capset_version,
--
1.8.3.1
- [Qemu-devel] [PULL 0/5] vga patch queue, Gerd Hoffmann, 2017/01/11
- [Qemu-devel] [PULL 4/5] virtio-gpu: Fix memory leak in virtio_gpu_load(), Gerd Hoffmann, 2017/01/11
- [Qemu-devel] [PULL 5/5] virtio-gpu: tag as not hotpluggable, Gerd Hoffmann, 2017/01/11
- [Qemu-devel] [PULL 3/5] virtio-gpu: Recalculate VirtIOGPU::hostmem on VM load, Gerd Hoffmann, 2017/01/11
- [Qemu-devel] [PULL 1/5] virtio-gpu: fix information leak in capset get dispatch,
Gerd Hoffmann <=
- [Qemu-devel] [PULL 2/5] display: cirrus: ignore source pitch value as needed in blit_is_unsafe, Gerd Hoffmann, 2017/01/11
- Re: [Qemu-devel] [PULL 0/5] vga patch queue, Peter Maydell, 2017/01/12