diff options
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.patch | 46 |
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 @@ | |||
1 | vhost-user-gpu: fix memory leak in 'virgl_cmd_resource_unref' (CVE-2021-3544) | ||
2 | |||
3 | The 'res->iov' will be leaked if the guest trigger following sequences: | ||
4 | |||
5 | virgl_cmd_create_resource_2d | ||
6 | virgl_resource_attach_backing | ||
7 | virgl_cmd_resource_unref | ||
8 | |||
9 | This patch fixes this. | ||
10 | |||
11 | Fixes: CVE-2021-3544 | ||
12 | Reported-by: default avatarLi Qiang <liq3ea@163.com> | ||
13 | virtio-gpu fix: 5e8e3c4c | ||
14 | |||
15 | ("virtio-gpu: fix resource leak | ||
16 | in virgl_cmd_resource_unref" | ||
17 | Signed-off-by: default avatarLi Qiang <liq3ea@163.com> | ||
18 | Reviewed-by: Marc-André Lureau's avatarMarc-André Lureau <marcandre.lureau@redhat.com> | ||
19 | Message-Id: <20210516030403.107723-6-liq3ea@163.com> | ||
20 | Signed-off-by: Gerd Hoffmann's avatarGerd Hoffmann <kraxel@redhat.com> | ||
21 | |||
22 | Upstream-Status: Backport | ||
23 | CVE: CVE-2021-3544 | ||
24 | Signed-off-by: Armin Kuster <akuster@mvista.com> | ||
25 | |||
26 | Index: 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 | |||