All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] virtio: fix virtio_add_queue() queue size Coverity issue
@ 2026-07-30 20:58 Stefan Hajnoczi
  2026-07-30 20:58 ` [PATCH v2 1/2] virtio: make virtio_add_queue() queue_size an unsigned int Stefan Hajnoczi
  2026-07-30 20:58 ` [PATCH v2 2/2] virtio: use Error for queue size validation in virtio_add_queue() Stefan Hajnoczi
  0 siblings, 2 replies; 10+ messages in thread
From: Stefan Hajnoczi @ 2026-07-30 20:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Kevin Wolf, Alex Bennée, virtio-fs,
	Hanna Reitz, Gerd Hoffmann, Michael S. Tsirkin, Milan Zamazal,
	Christian Schoenebeck, Dmitry Osipenko, Marc-André Lureau,
	Manos Pitsidianakis, Dorjoy Chowdhury, Gonglei (Arei),
	Stefan Hajnoczi, Alexander Graf, Laurent Vivier, Jason Wang,
	David Hildenbrand, Paolo Bonzini, Fam Zheng, Akihiko Odaki,
	qemu-block, Greg Kurz, Raphael Norwitz, Eric Auger,
	Stefano Garzarella, Kuan-Wei Chiu, Amit Shah

v2:
- Deal with x-override-queue-size, the root cause for the Coverity issue
  [Peter]

virtio_add_queue() uses int rather than unsigned int for the virtqueue size. It
also fails to validate the x-override-queue-size qdev property. Refactor the
code to solve these issues.

Patch 2 adds an Error **errp argument to virtio_add_queue() and changes all
callers to pass &error_abort. This solution requires many code changes, but
it's a step in the direction of propagating errors and that should be the
long-term goal.

Stefan Hajnoczi (2):
  virtio: make virtio_add_queue() queue_size an unsigned int
  virtio: use Error for queue size validation in virtio_add_queue()

 include/hw/virtio/virtio.h     |  4 ++--
 hw/9pfs/virtio-9p-device.c     |  2 +-
 hw/audio/virtio-snd.c          |  8 +++----
 hw/block/vhost-user-blk.c      |  3 ++-
 hw/block/virtio-blk.c          |  3 ++-
 hw/char/virtio-serial-bus.c    | 14 ++++++------
 hw/display/virtio-gpu-base.c   |  8 +++----
 hw/input/virtio-input.c        |  6 ++++--
 hw/net/virtio-net.c            | 15 ++++++++-----
 hw/scsi/virtio-scsi.c          |  9 +++++---
 hw/virtio/vdpa-dev.c           |  3 ++-
 hw/virtio/vhost-user-base.c    |  3 ++-
 hw/virtio/vhost-user-fs.c      |  8 +++++--
 hw/virtio/vhost-user-scmi.c    |  6 ++++--
 hw/virtio/vhost-vsock-common.c |  9 +++++---
 hw/virtio/virtio-balloon.c     | 15 ++++++++-----
 hw/virtio/virtio-crypto.c      |  6 ++++--
 hw/virtio/virtio-iommu.c       |  6 ++++--
 hw/virtio/virtio-mem.c         |  3 ++-
 hw/virtio/virtio-nsm.c         |  2 +-
 hw/virtio/virtio-pmem.c        |  2 +-
 hw/virtio/virtio-rng.c         |  2 +-
 hw/virtio/virtio-rtc.c         |  3 ++-
 hw/virtio/virtio.c             | 39 +++++++++++++++++++++++++++++-----
 24 files changed, 122 insertions(+), 57 deletions(-)

-- 
2.55.0


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

end of thread, other threads:[~2026-07-31  8:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-30 20:58 [PATCH v2 0/2] virtio: fix virtio_add_queue() queue size Coverity issue Stefan Hajnoczi
2026-07-30 20:58 ` [PATCH v2 1/2] virtio: make virtio_add_queue() queue_size an unsigned int Stefan Hajnoczi
2026-07-31  6:32   ` Laurent Vivier
2026-07-31  8:35   ` Philippe Mathieu-Daudé
2026-07-31  8:38     ` Philippe Mathieu-Daudé
2026-07-31  8:59     ` Peter Maydell
2026-07-30 20:58 ` [PATCH v2 2/2] virtio: use Error for queue size validation in virtio_add_queue() Stefan Hajnoczi
2026-07-31  6:58   ` Laurent Vivier
2026-07-31  8:03   ` Kevin Wolf
2026-07-31  8:58   ` Peter Maydell

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.