virtio-gpu: reject non-32bpp cursor resources
Get series with b4
b4 am [email protected] change-id 20261104-master-b659997e3be3Versions newest first
- v1 Latest4 patches 8 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | virtio-gpu: make some 2d callbacks staticshw/ include/ | +7 | 2 replies | |
| 2/4 | virtio-gpu/gl: reject non-32bpp cursor resourceshw/ include/ | +31 | 2 replies | |
| 3/4 | virtio-gpu/rutabaga: reject non-32bpp cursor resourceshw/ | +16 | 2 replies | |
| 4/4 | contrib/vhost-user-gpu: reject non-32bpp cursor resourcescontrib/ contrib/ contrib/ | +39 | 2 replies |
Reviews trailers per patch
All 4 patches have a Reviewed-by or Acked-by.
| Patch | Daniel P. Berrangé | Akihiko Odaki |
|---|---|---|
| 1/4 | R-b | R-b |
| 2/4 | R-b | R-b |
| 3/4 | R-b | R-b |
| 4/4 | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/4] virtio-gpu: reject non-32bpp cursor resources
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
---
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,
Signature · 1 line
Marc-André Lureau <[email protected]>