All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] virtio-gpu: reject non-32bpp cursor resources
@ 2026-11-10  8:31 Marc-André Lureau
  2026-11-10  8:31 ` [PATCH 1/4] virtio-gpu: make some 2d callbacks statics Marc-André Lureau
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Marc-André Lureau @ 2026-11-10  8:31 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, Alex Bennée, Akihiko Odaki,
	Dmitry Osipenko, Stefano Garzarella, Gurchetan Singh,
	Marc-André Lureau

Cursor data is copied out of the resource as 32bpp BGRA by every
accelerated backend, but none of them checks the resource format first.
(the 2d backend rejects any resource format that is not 32bpp already)

Refuse cursor resources that are not 32bpp in the three backends,
reusing virtio_gpu_get_pixman_format() as the allowlist, and log the
dimension mismatch in the rutabaga backend as the others do. Supported
formats keep working unchanged.

The vhost-user-gpu cursor path also leaked the virgl buffer when the
size check failed, so a guest could grow the backend memory with
repeated UPDATE_CURSOR commands. Release it with g_autofree, and skip
the update instead of sending zero-filled cursor pixels when no data
was produced.

First patch is a trivial cleanup.

The virglrenderer side is fixed with
https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/1703

Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4756
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
Marc-André Lureau (4):
      virtio-gpu: make some 2d callbacks statics
      virtio-gpu/gl: reject non-32bpp cursor resources
      virtio-gpu/rutabaga: reject non-32bpp cursor resources
      contrib/vhost-user-gpu: reject non-32bpp cursor resources

 contrib/vhost-user-gpu/vhost-user-gpu.c | 31 ++++++++++++++++++++-----------
 contrib/vhost-user-gpu/virgl.c          | 25 ++++++++++++++++++-------
 contrib/vhost-user-gpu/virgl.h          |  2 +-
 hw/display/virtio-gpu-gl.c              | 18 ++++++++++++++++++
 hw/display/virtio-gpu-rutabaga.c        | 19 ++++++++++++++++---
 hw/display/virtio-gpu.c                 | 12 +++++++-----
 include/hw/virtio/virtio-gpu-pixman.h   | 13 +++++++++++++
 include/hw/virtio/virtio-gpu.h          |  4 ----
 8 files changed, 93 insertions(+), 31 deletions(-)
---
base-commit: 723622bedb0b423de7d1c61ebbe6e7a71934949c
change-id: 20261104-master-b659997e3be3

Best regards,
--  
Marc-André Lureau <marcandre.lureau@redhat.com>



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-11-11 13:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-10  8:31 [PATCH 0/4] virtio-gpu: reject non-32bpp cursor resources Marc-André Lureau
2026-11-10  8:31 ` [PATCH 1/4] virtio-gpu: make some 2d callbacks statics Marc-André Lureau
2026-11-10  8:49   ` Daniel P. Berrangé
2026-11-11 13:13   ` Akihiko Odaki
2026-11-10  8:31 ` [PATCH 2/4] virtio-gpu/gl: reject non-32bpp cursor resources Marc-André Lureau
2026-11-10  8:53   ` Daniel P. Berrangé
2026-11-11 13:19     ` Akihiko Odaki
2026-11-10  8:31 ` [PATCH 3/4] virtio-gpu/rutabaga: " Marc-André Lureau
2026-11-10  8:54   ` Daniel P. Berrangé
2026-11-11 13:21   ` Akihiko Odaki
2026-11-10  8:31 ` [PATCH 4/4] contrib/vhost-user-gpu: " Marc-André Lureau
2026-11-10  8:56   ` Daniel P. Berrangé
2026-11-11 13:29   ` Akihiko Odaki

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.