summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/qemu/qemu/CVE-2021-4207.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu/CVE-2021-4207.patch')
-rw-r--r--meta/recipes-devtools/qemu/qemu/CVE-2021-4207.patch43
1 files changed, 43 insertions, 0 deletions
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..8418246247
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/CVE-2021-4207.patch
@@ -0,0 +1,43 @@
1From 9569f5cb5b4bffa9d3ebc8ba7da1e03830a9a895 Mon Sep 17 00:00:00 2001
2From: Mauro Matteo Cascella <mcascell@redhat.com>
3Date: Thu, 7 Apr 2022 10:11:06 +0200
4Subject: [PATCH] display/qxl-render: fix race condition in qxl_cursor
5 (CVE-2021-4207)
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10Avoid fetching 'width' and 'height' a second time to prevent possible
11race condition. Refer to security advisory
12https://starlabs.sg/advisories/22-4207/ for more information.
13
14Fixes: CVE-2021-4207
15Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
16Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
17Message-Id: <20220407081106.343235-1-mcascell@redhat.com>
18Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
19
20https://gitlab.com/qemu-project/qemu/-/commit/9569f5cb
21CVE: CVE-2021-4207
22Upstream-Status: Backport
23Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
24---
25 hw/display/qxl-render.c | 2 +-
26 1 file changed, 1 insertion(+), 1 deletion(-)
27
28diff --git a/hw/display/qxl-render.c b/hw/display/qxl-render.c
29index d28849b121..237ed293ba 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--
42GitLab
43