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

Bin Guo posted 3 patches 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/cover.1782270919.git.guobin@linux.alibaba.com
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>, Dmitry Osipenko <dmitry.osipenko@collabora.com>, "Michael S. Tsirkin" <mst@redhat.com>
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(-)
[PATCH 0/3] virtio-gpu: security, logging and UB fixes
Posted by Bin Guo 1 month ago
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(-)

-- 
2.50.1 (Apple Git-155)