Skip to content

virtio-gpu: security, logging and UB fixes

Bin Guo qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3virtio-gpu-virgl: validate resource existence on ctx attach/detachhw/display/virtio-gpu-virgl.c+16 -22 replies
2/3virtio-gpu-virgl: replace fprintf(stderr) with qemu_log_mask and trace eventshw/display/trace-events hw/display/virtio-gpu-virgl.c+9 -82 replies
3/3virtio-gpu: use unsigned shift for scanout bitmask operationshw/display/virtio-gpu.c+6 -62 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchMarc-André Lureau
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] virtio-gpu: security, logging and UB fixes

Three small fixes for virtio-gpu, each independent:

1. Add resource validation to CTX_ATTACH/DETACH_RESOURCE handlers, resolving the long-standing "TODO add security" comments.

2. Replace three fprintf(stderr) calls with qemu_log_mask(LOG_GUEST_ERROR) and trace events, consistent with the rest of the virtio-gpu code.

3. Use unsigned shift (1U <<) for scanout_bitmask operations to avoid undefined behavior when the shift count could theoretically reach 31.

Bin Guo (3):
virtio-gpu-virgl: validate resource existence on ctx attach/detach
virtio-gpu-virgl: replace fprintf(stderr) with qemu_log_mask and trace
events
virtio-gpu: use unsigned shift for scanout bitmask operations

 hw/display/trace-events       |  2 ++
 hw/display/virtio-gpu-virgl.c | 33 +++++++++++++++++++++++----------
 hw/display/virtio-gpu.c       | 12 ++++++------
 3 files changed, 31 insertions(+), 16 deletions(-)
Signature · 1 line
2.50.1 (Apple Git-155)