diff options
author | Armin Kuster <akuster@mvista.com> | 2021-08-23 21:27:42 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-09-01 16:27:09 +0100 |
commit | 189108ac7441a2232829b519d9834aa3e7d2713a (patch) | |
tree | 0d76be302cf8c3560182b2f5e639eee9deacee0c /meta | |
parent | 0d253da7204bbba3fbdf6fa479bbb723e122e2bd (diff) | |
download | poky-189108ac7441a2232829b519d9834aa3e7d2713a.tar.gz |
qemu: Security fixes CVE-2021-3545/6
Source: qemu.org
MR: 111845, 111839
Type: Security Fix
Disposition: Backport from https://gitlab.com/qemu-project/qemu/-/commit/9f22893a & 121841b2
ChangeID: 111b168e0fe4d2a722158c6bfdaceb06a8789e69
Description:
Fixes: CVE-2021-3545 and CVE-2021-3546
(From OE-Core rev: e066967a306292cd0ce5ef2cd5aa0ee80fde1041)
Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-devtools/qemu/qemu.inc | 2 | ||||
-rw-r--r-- | meta/recipes-devtools/qemu/qemu/CVE-2021-3545.patch | 41 | ||||
-rw-r--r-- | meta/recipes-devtools/qemu/qemu/CVE-2021-3546.patch | 47 |
3 files changed, 90 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index 90549136e5..028b81ee34 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc | |||
@@ -77,6 +77,8 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ | |||
77 | file://CVE-2021-3544_3.patch \ | 77 | file://CVE-2021-3544_3.patch \ |
78 | file://CVE-2021-3544_4.patch \ | 78 | file://CVE-2021-3544_4.patch \ |
79 | file://CVE-2021-3544_5.patch \ | 79 | file://CVE-2021-3544_5.patch \ |
80 | file://CVE-2021-3545.patch \ | ||
81 | file://CVE-2021-3546.patch \ | ||
80 | " | 82 | " |
81 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" | 83 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" |
82 | 84 | ||
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2021-3545.patch b/meta/recipes-devtools/qemu/qemu/CVE-2021-3545.patch new file mode 100644 index 0000000000..fcdda64437 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2021-3545.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | From 121841b25d72d13f8cad554363138c360f1250ea Mon Sep 17 00:00:00 2001 | ||
2 | From: Li Qiang <liq3ea@163.com> | ||
3 | Date: Sat, 15 May 2021 20:03:56 -0700 | ||
4 | Subject: [PATCH] vhost-user-gpu: fix memory disclosure in | ||
5 | virgl_cmd_get_capset_info (CVE-2021-3545) | ||
6 | MIME-Version: 1.0 | ||
7 | Content-Type: text/plain; charset=UTF-8 | ||
8 | Content-Transfer-Encoding: 8bit | ||
9 | |||
10 | Otherwise some of the 'resp' will be leaked to guest. | ||
11 | |||
12 | Fixes: CVE-2021-3545 | ||
13 | Reported-by: Li Qiang <liq3ea@163.com> | ||
14 | virtio-gpu fix: 42a8dadc74 ("virtio-gpu: fix information leak | ||
15 | in getting capset info dispatch") | ||
16 | |||
17 | Signed-off-by: Li Qiang <liq3ea@163.com> | ||
18 | Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> | ||
19 | Message-Id: <20210516030403.107723-2-liq3ea@163.com> | ||
20 | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> | ||
21 | |||
22 | Upstream-Status: Backport | ||
23 | CVE: CVE-2021-3545 | ||
24 | Signed-off-by: Armin Kuster <akuster@mvista.com> | ||
25 | |||
26 | --- | ||
27 | contrib/vhost-user-gpu/virgl.c | 1 + | ||
28 | 1 file changed, 1 insertion(+) | ||
29 | |||
30 | Index: qemu-4.2.0/contrib/vhost-user-gpu/virgl.c | ||
31 | =================================================================== | ||
32 | --- qemu-4.2.0.orig/contrib/vhost-user-gpu/virgl.c | ||
33 | +++ qemu-4.2.0/contrib/vhost-user-gpu/virgl.c | ||
34 | @@ -132,6 +132,7 @@ virgl_cmd_get_capset_info(VuGpu *g, | ||
35 | |||
36 | VUGPU_FILL_CMD(info); | ||
37 | |||
38 | + memset(&resp, 0, sizeof(resp)); | ||
39 | if (info.capset_index == 0) { | ||
40 | resp.capset_id = VIRTIO_GPU_CAPSET_VIRGL; | ||
41 | virgl_renderer_get_cap_set(resp.capset_id, | ||
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2021-3546.patch b/meta/recipes-devtools/qemu/qemu/CVE-2021-3546.patch new file mode 100644 index 0000000000..f8da428233 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2021-3546.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From 9f22893adcb02580aee5968f32baa2cd109b3ec2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Li Qiang <liq3ea@163.com> | ||
3 | Date: Sat, 15 May 2021 20:04:02 -0700 | ||
4 | Subject: [PATCH] vhost-user-gpu: fix OOB write in 'virgl_cmd_get_capset' | ||
5 | (CVE-2021-3546) | ||
6 | MIME-Version: 1.0 | ||
7 | Content-Type: text/plain; charset=UTF-8 | ||
8 | Content-Transfer-Encoding: 8bit | ||
9 | |||
10 | If 'virgl_cmd_get_capset' set 'max_size' to 0, | ||
11 | the 'virgl_renderer_fill_caps' will write the data after the 'resp'. | ||
12 | This patch avoid this by checking the returned 'max_size'. | ||
13 | |||
14 | virtio-gpu fix: abd7f08b23 ("display: virtio-gpu-3d: check | ||
15 | virgl capabilities max_size") | ||
16 | |||
17 | Fixes: CVE-2021-3546 | ||
18 | Reported-by: Li Qiang <liq3ea@163.com> | ||
19 | Reviewed-by: Prasad J Pandit <pjp@fedoraproject.org> | ||
20 | Signed-off-by: Li Qiang <liq3ea@163.com> | ||
21 | Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> | ||
22 | Message-Id: <20210516030403.107723-8-liq3ea@163.com> | ||
23 | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> | ||
24 | |||
25 | Upstream-Status: Backport | ||
26 | CVE: CVE-2021-3546 | ||
27 | Signed-off-by: Armin Kuster <akuster@mvista.com> | ||
28 | |||
29 | --- | ||
30 | contrib/vhost-user-gpu/virgl.c | 4 ++++ | ||
31 | 1 file changed, 4 insertions(+) | ||
32 | |||
33 | Index: qemu-4.2.0/contrib/vhost-user-gpu/virgl.c | ||
34 | =================================================================== | ||
35 | --- qemu-4.2.0.orig/contrib/vhost-user-gpu/virgl.c | ||
36 | +++ qemu-4.2.0/contrib/vhost-user-gpu/virgl.c | ||
37 | @@ -174,6 +174,10 @@ virgl_cmd_get_capset(VuGpu *g, | ||
38 | |||
39 | virgl_renderer_get_cap_set(gc.capset_id, &max_ver, | ||
40 | &max_size); | ||
41 | + if (!max_size) { | ||
42 | + cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER; | ||
43 | + return; | ||
44 | + } | ||
45 | resp = g_malloc0(sizeof(*resp) + max_size); | ||
46 | |||
47 | resp->hdr.type = VIRTIO_GPU_RESP_OK_CAPSET; | ||