* [PATCH v2] display/qxl-render: fix race condition in qxl_cursor (CVE-2021-4207)
@ 2022-04-07 8:11 Mauro Matteo Cascella
2022-04-07 9:16 ` Marc-André Lureau
0 siblings, 1 reply; 2+ messages in thread
From: Mauro Matteo Cascella @ 2022-04-07 8:11 UTC (permalink / raw)
To: qemu-devel; +Cc: mcascell, kraxel
Avoid fetching 'width' and 'height' a second time to prevent possible
race condition. Refer to security advisory
https://starlabs.sg/advisories/22-4207/ for more information.
Fixes: CVE-2021-4207
Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
---
v2:
- fix CVE id (CVE-2021-4207 instead of CVE-2022-4207)
hw/display/qxl-render.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/display/qxl-render.c b/hw/display/qxl-render.c
index d28849b121..237ed293ba 100644
--- a/hw/display/qxl-render.c
+++ b/hw/display/qxl-render.c
@@ -266,7 +266,7 @@ static QEMUCursor *qxl_cursor(PCIQXLDevice *qxl, QXLCursor *cursor,
}
break;
case SPICE_CURSOR_TYPE_ALPHA:
- size = sizeof(uint32_t) * cursor->header.width * cursor->header.height;
+ size = sizeof(uint32_t) * c->width * c->height;
qxl_unpack_chunks(c->data, size, qxl, &cursor->chunk, group_id);
if (qxl->debug > 2) {
cursor_print_ascii_art(c, "qxl/alpha");
--
2.35.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] display/qxl-render: fix race condition in qxl_cursor (CVE-2021-4207)
2022-04-07 8:11 [PATCH v2] display/qxl-render: fix race condition in qxl_cursor (CVE-2021-4207) Mauro Matteo Cascella
@ 2022-04-07 9:16 ` Marc-André Lureau
0 siblings, 0 replies; 2+ messages in thread
From: Marc-André Lureau @ 2022-04-07 9:16 UTC (permalink / raw)
To: Mauro Matteo Cascella; +Cc: QEMU, Gerd Hoffmann
[-- Attachment #1: Type: text/plain, Size: 1296 bytes --]
On Thu, Apr 7, 2022 at 12:11 PM Mauro Matteo Cascella <mcascell@redhat.com>
wrote:
> Avoid fetching 'width' and 'height' a second time to prevent possible
> race condition. Refer to security advisory
> https://starlabs.sg/advisories/22-4207/ for more information.
>
> Fixes: CVE-2021-4207
> Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> v2:
> - fix CVE id (CVE-2021-4207 instead of CVE-2022-4207)
>
> hw/display/qxl-render.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/display/qxl-render.c b/hw/display/qxl-render.c
> index d28849b121..237ed293ba 100644
> --- a/hw/display/qxl-render.c
> +++ b/hw/display/qxl-render.c
> @@ -266,7 +266,7 @@ static QEMUCursor *qxl_cursor(PCIQXLDevice *qxl,
> QXLCursor *cursor,
> }
> break;
> case SPICE_CURSOR_TYPE_ALPHA:
> - size = sizeof(uint32_t) * cursor->header.width *
> cursor->header.height;
> + size = sizeof(uint32_t) * c->width * c->height;
> qxl_unpack_chunks(c->data, size, qxl, &cursor->chunk, group_id);
> if (qxl->debug > 2) {
> cursor_print_ascii_art(c, "qxl/alpha");
> --
> 2.35.1
>
>
>
--
Marc-André Lureau
[-- Attachment #2: Type: text/html, Size: 2188 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-07 9:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-07 8:11 [PATCH v2] display/qxl-render: fix race condition in qxl_cursor (CVE-2021-4207) Mauro Matteo Cascella
2022-04-07 9:16 ` Marc-André Lureau
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.