diff options
| author | Davide Gardenal <davidegarde2000@gmail.com> | 2022-05-16 10:54:48 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-05-20 10:08:06 +0100 |
| commit | e977c0cf23fc687d3062abf5ac030c0d58eb9619 (patch) | |
| tree | 7a34fd24a02c93acf9b1143d34d575db7dd9d8c3 | |
| parent | d6e618ac2e096094c04ddc615059bd1976c5a851 (diff) | |
| download | poky-e977c0cf23fc687d3062abf5ac030c0d58eb9619.tar.gz | |
qemu: backport patch for CVE-2021-4207
CVE: CVE-2021-4207
Upstream fix:
https://git.qemu.org/?p=qemu.git;a=commit;h=9569f5cb5b4bffa9d3ebc8ba7da1e03830a9a895
(From OE-Core rev: 4150733448aee4c27340565a4f79c86d160b2b08)
Signed-off-by: Davide Gardenal <davide.gardenal@huawei.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-devtools/qemu/qemu.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-devtools/qemu/qemu/CVE-2021-4207.patch | 43 |
2 files changed, 44 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index b7762f83a8..cc69eca9ae 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc | |||
| @@ -34,6 +34,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ | |||
| 34 | file://0002-virtio-net-fix-map-leaking-on-error-during-receive.patch \ | 34 | file://0002-virtio-net-fix-map-leaking-on-error-during-receive.patch \ |
| 35 | file://pvrdma.patch \ | 35 | file://pvrdma.patch \ |
| 36 | file://CVE-2021-4206.patch \ | 36 | file://CVE-2021-4206.patch \ |
| 37 | file://CVE-2021-4207.patch \ | ||
| 37 | " | 38 | " |
| 38 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" | 39 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" |
| 39 | 40 | ||
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2021-4207.patch b/meta/recipes-devtools/qemu/qemu/CVE-2021-4207.patch new file mode 100644 index 0000000000..38f36abd9e --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2021-4207.patch | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | From 9569f5cb5b4bffa9d3ebc8ba7da1e03830a9a895 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Mauro Matteo Cascella <mcascell@redhat.com> | ||
| 3 | Date: Thu, 7 Apr 2022 10:11:06 +0200 | ||
| 4 | Subject: [PATCH] display/qxl-render: fix race condition in qxl_cursor | ||
| 5 | (CVE-2021-4207) | ||
| 6 | MIME-Version: 1.0 | ||
| 7 | Content-Type: text/plain; charset=utf8 | ||
| 8 | Content-Transfer-Encoding: 8bit | ||
| 9 | |||
| 10 | Avoid fetching 'width' and 'height' a second time to prevent possible | ||
| 11 | race condition. Refer to security advisory | ||
| 12 | https://starlabs.sg/advisories/22-4207/ for more information. | ||
| 13 | |||
| 14 | Fixes: CVE-2021-4207 | ||
| 15 | Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com> | ||
| 16 | Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> | ||
| 17 | Message-Id: <20220407081106.343235-1-mcascell@redhat.com> | ||
| 18 | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> | ||
| 19 | |||
| 20 | Upstream-Status: Backport | ||
| 21 | https://git.qemu.org/?p=qemu.git;a=commit;h=9569f5cb5b4bffa9d3ebc8ba7da1e03830a9a895 | ||
| 22 | |||
| 23 | Signed-off-by: Davide Gardenal <davide.gardenal@huawei.com> | ||
| 24 | --- | ||
| 25 | hw/display/qxl-render.c | 2 +- | ||
| 26 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 27 | |||
| 28 | diff --git a/hw/display/qxl-render.c b/hw/display/qxl-render.c | ||
| 29 | index d28849b..237ed29 100644 | ||
| 30 | --- a/hw/display/qxl-render.c | ||
| 31 | +++ b/hw/display/qxl-render.c | ||
| 32 | @@ -266,7 +266,7 @@ static QEMUCursor *qxl_cursor(PCIQXLDevice *qxl, QXLCursor *cursor, | ||
| 33 | } | ||
| 34 | break; | ||
| 35 | case SPICE_CURSOR_TYPE_ALPHA: | ||
| 36 | - size = sizeof(uint32_t) * cursor->header.width * cursor->header.height; | ||
| 37 | + size = sizeof(uint32_t) * c->width * c->height; | ||
| 38 | qxl_unpack_chunks(c->data, size, qxl, &cursor->chunk, group_id); | ||
| 39 | if (qxl->debug > 2) { | ||
| 40 | cursor_print_ascii_art(c, "qxl/alpha"); | ||
| 41 | -- | ||
| 42 | 1.8.3.1 | ||
| 43 | |||
