Blame SOURCES/kvm-display-qxl-render-fix-race-condition-in-qxl_cursor-.patch

0727d3
From abd84f26e0fe0bc9952d91fbd35fb3a7253cfecf Mon Sep 17 00:00:00 2001
0727d3
From: Jon Maloy <jmaloy@rehat.com>
0727d3
Date: Wed, 13 Apr 2022 20:54:45 -0400
0727d3
Subject: [PATCH 1/2] display/qxl-render: fix race condition in qxl_cursor
0727d3
 (CVE-2021-4207)
0727d3
MIME-Version: 1.0
0727d3
Content-Type: text/plain; charset=UTF-8
0727d3
Content-Transfer-Encoding: 8bit
0727d3
0727d3
RH-Author: Jon Maloy <jmaloy@redhat.com>
0727d3
RH-MergeRequest: 152: display/qxl-render: fix race condition in qxl_cursor (CVE-2021-4207)
0727d3
RH-Commit: [1/1] f05b9a956f2e0ca522b5be127beff813d04b5588 (jmaloy/qemu-kvm)
0727d3
RH-Bugzilla: 2040738
0727d3
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
0727d3
RH-Acked-by: Mauro Matteo Cascella <None>
0727d3
0727d3
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2040738
0727d3
Upstream: Merged
0727d3
CVE: CVE-2021-4207
0727d3
0727d3
commit 9569f5cb5b4bffa9d3ebc8ba7da1e03830a9a895
0727d3
Author: Mauro Matteo Cascella <mcascell@redhat.com>
0727d3
Date:   Thu Apr 7 10:11:06 2022 +0200
0727d3
0727d3
    display/qxl-render: fix race condition in qxl_cursor (CVE-2021-4207)
0727d3
0727d3
    Avoid fetching 'width' and 'height' a second time to prevent possible
0727d3
    race condition. Refer to security advisory
0727d3
    https://starlabs.sg/advisories/22-4207/ for more information.
0727d3
0727d3
    Fixes: CVE-2021-4207
0727d3
    Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
0727d3
    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
0727d3
    Message-Id: <20220407081106.343235-1-mcascell@redhat.com>
0727d3
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
0727d3
0727d3
(cherry picked from commit 9569f5cb5b4bffa9d3ebc8ba7da1e03830a9a895)
0727d3
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
0727d3
---
0727d3
 hw/display/qxl-render.c | 2 +-
0727d3
 1 file changed, 1 insertion(+), 1 deletion(-)
0727d3
0727d3
diff --git a/hw/display/qxl-render.c b/hw/display/qxl-render.c
0727d3
index d28849b121..237ed293ba 100644
0727d3
--- a/hw/display/qxl-render.c
0727d3
+++ b/hw/display/qxl-render.c
0727d3
@@ -266,7 +266,7 @@ static QEMUCursor *qxl_cursor(PCIQXLDevice *qxl, QXLCursor *cursor,
0727d3
         }
0727d3
         break;
0727d3
     case SPICE_CURSOR_TYPE_ALPHA:
0727d3
-        size = sizeof(uint32_t) * cursor->header.width * cursor->header.height;
0727d3
+        size = sizeof(uint32_t) * c->width * c->height;
0727d3
         qxl_unpack_chunks(c->data, size, qxl, &cursor->chunk, group_id);
0727d3
         if (qxl->debug > 2) {
0727d3
             cursor_print_ascii_art(c, "qxl/alpha");
0727d3
-- 
0727d3
2.27.0
0727d3