@samitouri / QOSamiQemu / commits / d3c2da174c

hw/display/virtio-gpu: Check cursor data presence

Reject a blob that lacks the backing storage for VIRTIO_GPU_CMD_UPDATE_CURSOR. Fixes: bdd53f739273 ("virtio-gpu: Update cursor data using blob") Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20260825-dmabuf-v2-4-b3d64d3b9a0e@rsg.ci.i.u-tokyo.ac.jp>

Akihiko Odaki committed Aug 25, 2026 at 16:28 UTC d3c2da174ca69161eafeb82d98d0117150017909
1 file changed +2 -2
hw/display/virtio-gpu.c
+2 -2
@@ -63,8 +63,8 @@ void virtio_gpu_update_cursor_data(VirtIOGPU *g,
63 }
64 data = pixman_image_get_data(res->image);
65 } else {
66 - if (res->blob_size < (s->current_cursor->width *
67 - s->current_cursor->height * 4)) {
66 + if (!res->iov || res->blob_size < (s->current_cursor->width *
67 + s->current_cursor->height * 4)) {
68 return;
69 }
70 data = res->blob;