From: "Michael S. Tsirkin" <mst@redhat.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: qemu-devel@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>,
"Yonggang Luo" <luoyonggang@gmail.com>,
"Miku Hatsune" <anznu1l@gmail.com>,
"Philippe Mathieu-Daudé" <philmd@mailo.com>,
"Zhao Liu" <zhao1.liu@intel.com>,
"QEMU Stable" <qemu-stable@nongnu.org>
Subject: Re: [PULL v2 09/30] virtio-mmio: fix QUEUE_NUM_MAX
Date: Tue, 28 Jul 2026 15:45:37 -0400 [thread overview]
Message-ID: <20260728154328-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <65990a19-6a7e-4c1c-9354-0fffa13cbba9@tls.msk.ru>
On Tue, Jul 28, 2026 at 11:40:24AM +0300, Michael Tokarev wrote:
> On 7/27/26 22:19, Michael S. Tsirkin wrote:
> > virtio-mmio reports VIRTQUEUE_MAX_SIZE (1024) as QUEUE_NUM_MAX for every
> > queue, regardless of the size the device passes to virtio_add_queue().
> >
> > This works by accident because QEMU mostly does not care about the ring
> > size - the guest is the one allocating memory here. But this changes
> > with in-order vqs where qemu is the one allocating resources.
> > Now, specifying a larger vq than allocated causes an OOB memory access.
> >
> > To fix:
> > - for new machine types, report the actual max queue size to guest
> > - for old machine types, use a compat property to allocate 1k sized
> > queues
> >
> > Fixes: 525d82e323 ("virtio: fix queue size validation against allocated maximum")
>
> This is actually d530f2dfbd2 in the master branch.
> But his is an interesting case of the Fixes: tag.
>
> The change it is fixing (this non-existing commit) is in
> the same pull request and comes right NEXT to this fix!
> So we fix something first and introduce it.. later? :)
>
> It's a fun stuff.
Got some wires crossed here) thanks for noticing.
> But besides this, I wonder what can we do with that for
> the stable series...
>
> > Fixes: CVE-2026-50626
> > Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3882
> > Cc: Peter Maydell <peter.maydell@linaro.org>
> > Message-ID: <8715acbb9516e67e2a776cda6f9edf105343f788.1784930765.git.mst@redhat.com>
> > Acked-by: Yonggang Luo <luoyonggang@gmail.com>
> > Reported-by: Miku Hatsune <anznu1l@gmail.com>
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ...
> > diff --git a/hw/core/machine.c b/hw/core/machine.c
> > index 805148678d..73b4d82b4a 100644
> > --- a/hw/core/machine.c
> > +++ b/hw/core/machine.c
> > @@ -41,6 +41,7 @@
> > #include "hw/arm/smmuv3.h"
> > GlobalProperty hw_compat_11_0[] = {
> > + { "virtio-mmio", VIRTIO_QUEUE_SIZE_OVERRIDE, "1024" },
>
> ..because it is adding a new field into the migration stream,
> which is a problem for stable series.
this is compat not a migration stream, right?
For stable, the value needs to be 1024 for all types.
> Or is it a problem in previous releases?
>
> Thanks,
>
> /mjt
next prev parent reply other threads:[~2026-07-28 19:46 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 19:19 [PULL v2 00/30] pci, vhost, virtio, iommu: bugfixes Michael S. Tsirkin
2026-07-27 19:19 ` [PULL v2 01/30] virtio: use masked features with set_features_ex Michael S. Tsirkin
2026-07-28 7:26 ` Paolo Abeni
2026-07-27 19:19 ` [PULL v2 02/30] virtio-net: fix OOB read in RSC receive path Michael S. Tsirkin
2026-07-27 19:19 ` [PULL v2 03/30] virtio-net: fix short frame OOB read in receive_filter() Michael S. Tsirkin
2026-07-27 19:19 ` [PULL v2 04/30] libvhost-user: protect against OOB writes in vu_set_inflight_fd Michael S. Tsirkin
2026-07-27 19:19 ` [PULL v2 05/30] libvhost-user: protect against OOB vring queue access Michael S. Tsirkin
2026-07-27 19:19 ` [PULL v2 06/30] hw/virtio: reject zero-length packed indirect descriptor table Michael S. Tsirkin
2026-07-27 19:19 ` [PULL v2 07/30] vhost: do not crash on ring map failure Michael S. Tsirkin
2026-07-27 19:19 ` [PULL v2 08/30] virtio-scsi: fix SCSIRequest leak on a bad request Michael S. Tsirkin
2026-07-27 19:19 ` [PULL v2 09/30] virtio-mmio: fix QUEUE_NUM_MAX Michael S. Tsirkin
2026-07-28 8:40 ` Michael Tokarev
2026-07-28 19:45 ` Michael S. Tsirkin [this message]
2026-07-28 20:17 ` Michael Tokarev
2026-07-28 23:22 ` Michael S. Tsirkin
2026-07-29 5:12 ` Michael Tokarev
2026-07-29 5:24 ` Michael Tokarev
2026-07-27 19:19 ` [PULL v2 10/30] virtio: fix queue size validation against allocated maximum Michael S. Tsirkin
2026-07-27 19:20 ` [PULL v2 11/30] virtio: stop migrating num_default, validate vring.num on load Michael S. Tsirkin
2026-07-27 19:20 ` [PULL v2 12/30] virtio: fail early on bad config_len in migration Michael S. Tsirkin
2026-07-27 19:20 ` [PULL v2 13/30] vhost-user: assert nregions within limit Michael S. Tsirkin
2026-07-27 19:20 ` [PULL v2 14/30] virtio-pmem: wait for flush requests on unrealize Michael S. Tsirkin
2026-07-27 19:20 ` [PULL v2 15/30] libvhost-user: validate last_batch_head in vu_check_queue_inflights Michael S. Tsirkin
2026-07-27 19:20 ` [PULL v2 16/30] libvhost-user: fix heap overflow " Michael S. Tsirkin
2026-07-27 19:20 ` [PULL v2 17/30] libvduse: validate vq size Michael S. Tsirkin
2026-07-27 19:20 ` [PULL v2 18/30] virtio-iommu: fix OOM due to unbounded call_rcu Michael S. Tsirkin
2026-07-27 19:20 ` [PULL v2 19/30] virtio-snd: check rx buffer descriptor size Michael S. Tsirkin
2026-07-27 19:20 ` [PULL v2 20/30] virtio-snd: check for overflow before g_malloc0 Michael S. Tsirkin
2026-07-27 19:20 ` [PULL v2 21/30] hw/pci-host/q35.c: Always initialize smram-region even if SMM disabled Michael S. Tsirkin
2026-07-27 19:20 ` [PULL v2 22/30] hw/pci-host/q35.c: Factor out creation of SMRAM MRs Michael S. Tsirkin
2026-07-27 19:20 ` [PULL v2 23/30] hw/pci-host/q35.c: Avoid early return in mch_write_config() Michael S. Tsirkin
2026-07-27 19:20 ` [PULL v2 24/30] hw/virtio/vdpa-dev: pass set_config buffer to vhost backend Michael S. Tsirkin
2026-07-27 19:20 ` [PULL v2 25/30] hw/cxl: fix OOB access in cxl_doe_cdat_rsp via entry_handle Michael S. Tsirkin
2026-07-27 19:20 ` [PULL v2 26/30] intel_iommu: Check address mask before using it in pasid-based iotlb invalidation Michael S. Tsirkin
2026-07-27 19:20 ` [PULL v2 27/30] hw/net/virtio-net: Protect from DMA re-entrancy bugs Michael S. Tsirkin
2026-07-27 19:20 ` [PULL v2 28/30] hw/virtio-rng: Fix host use-after-free (CVE-2026-50624) Michael S. Tsirkin
2026-07-27 19:20 ` [PULL v2 29/30] backends/rng: cap request size to avoid oversized allocation Michael S. Tsirkin
2026-07-27 19:20 ` [PULL v2 30/30] virtio: avoid packed vring virtio_queue_empty() infinite loops (CVE-2026-16457) Michael S. Tsirkin
2026-07-28 11:42 ` [PULL v2 00/30] pci, vhost, virtio, iommu: bugfixes Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260728154328-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=anznu1l@gmail.com \
--cc=luoyonggang@gmail.com \
--cc=mjt@tls.msk.ru \
--cc=peter.maydell@linaro.org \
--cc=philmd@mailo.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=zhao1.liu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.