summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/qemu/qemu/CVE-2021-3544_4.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu/CVE-2021-3544_4.patch')
-rw-r--r--meta/recipes-devtools/qemu/qemu/CVE-2021-3544_4.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2021-3544_4.patch b/meta/recipes-devtools/qemu/qemu/CVE-2021-3544_4.patch
new file mode 100644
index 0000000000..96e36eb854
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/CVE-2021-3544_4.patch
@@ -0,0 +1,46 @@
1vhost-user-gpu: fix memory leak in 'virgl_cmd_resource_unref' (CVE-2021-3544)
2
3The 'res->iov' will be leaked if the guest trigger following sequences:
4
5virgl_cmd_create_resource_2d
6virgl_resource_attach_backing
7virgl_cmd_resource_unref
8
9This patch fixes this.
10
11Fixes: CVE-2021-3544
12Reported-by: default avatarLi Qiang <liq3ea@163.com>
13virtio-gpu fix: 5e8e3c4c
14
15("virtio-gpu: fix resource leak
16in virgl_cmd_resource_unref"
17Signed-off-by: default avatarLi Qiang <liq3ea@163.com>
18Reviewed-by: Marc-André Lureau's avatarMarc-André Lureau <marcandre.lureau@redhat.com>
19Message-Id: <20210516030403.107723-6-liq3ea@163.com>
20Signed-off-by: Gerd Hoffmann's avatarGerd Hoffmann <kraxel@redhat.com>
21
22Upstream-Status: Backport
23CVE: CVE-2021-3544
24Signed-off-by: Armin Kuster <akuster@mvista.com>
25
26Index: qemu-4.2.0/contrib/vhost-user-gpu/virgl.c
27===================================================================
28--- qemu-4.2.0.orig/contrib/vhost-user-gpu/virgl.c
29+++ qemu-4.2.0/contrib/vhost-user-gpu/virgl.c
30@@ -105,9 +105,16 @@ virgl_cmd_resource_unref(VuGpu *g,
31 struct virtio_gpu_ctrl_command *cmd)
32 {
33 struct virtio_gpu_resource_unref unref;
34+ struct iovec *res_iovs = NULL;
35+ int num_iovs = 0;
36
37 VUGPU_FILL_CMD(unref);
38
39+ virgl_renderer_resource_detach_iov(unref.resource_id,
40+ &res_iovs,
41+ &num_iovs);
42+ g_free(res_iovs);
43+
44 virgl_renderer_resource_unref(unref.resource_id);
45 }
46