From: Kevin Wolf <kwolf@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: "Laurent Vivier" <lvivier@redhat.com>,
qemu-devel@nongnu.org,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Hanna Reitz" <hreitz@redhat.com>, "Fam Zheng" <fam@euphon.net>,
qemu-block@nongnu.org, "Stefan Hajnoczi" <stefanha@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Amit Shah" <amit@kernel.org>
Subject: Re: [PATCH 0/3] Harden virtio migration load paths against crafted streams
Date: Tue, 28 Jul 2026 17:00:16 +0200 [thread overview]
Message-ID: <amjEALq8-unXNAZS@redhat.com> (raw)
In-Reply-To: <20260725113324-mutt-send-email-mst@kernel.org>
Am 25.07.2026 um 17:34 hat Michael S. Tsirkin geschrieben:
> On Fri, Jul 10, 2026 at 12:28:56PM +0200, Laurent Vivier wrote:
> > A crafted migration stream can crash the destination QEMU process
> > through unvalidated fields in the virtio device state: an unbounded
> > allocation in virtio-serial, reachable assertions in the shared
> > virtqueue element deserializer, and assert()/exit(1) calls in
> > virtio-scsi request loading.
> >
> > These are hardening fixes: the destination QEMU is in a paused
> > pre-start state and the source VM is unaffected by a failed migration.
> >
> > Patch 1 validates the virtio-serial nr_active_ports count against the
> > configured maximum before allocating the post-load array.
> >
> > Patch 2 replaces the assertions in qemu_get_virtqueue_element() with
> > a bounds check returning NULL, and updates all callers (virtio-serial,
> > virtio-blk, virtio-scsi, scsi-bus) to handle the failure gracefully.
> >
> > Patch 3 replaces the remaining assert() and exit(1) calls in
> > virtio_scsi_load_request() with proper error returns.
> >
> > Tested with migration round-trips for virtio-serial (0 to 511 ports),
> > virtio-blk (1-2 disks), and virtio-scsi (1-2 disks), plus the
> > original PoC reproducers for issues #3801 and #3802.
> >
> > Laurent Vivier (3):
> > hw/char/virtio-serial-bus: validate nr_active_ports from migration
> > stream
> > hw/virtio: return NULL from qemu_get_virtqueue_element() on invalid
> > state
> > hw/scsi/virtio-scsi: harden virtio_scsi_load_request() against invalid
> > stream
>
> Kevin objected to my version of this, I guess same will apply?
Objecting is a big word. I suggested some improvements around passing
errors to the caller instead of trying to handle everything locally. But
yes, at the first sight I think they would apply here, too.
Kevin
prev parent reply other threads:[~2026-07-28 15:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-10 10:28 [PATCH 0/3] Harden virtio migration load paths against crafted streams Laurent Vivier
2026-07-10 10:28 ` [PATCH 1/3] hw/char/virtio-serial-bus: validate nr_active_ports from migration stream Laurent Vivier
2026-07-10 10:28 ` [PATCH 2/3] hw/virtio: return NULL from qemu_get_virtqueue_element() on invalid state Laurent Vivier
2026-07-10 10:28 ` [PATCH 3/3] hw/scsi/virtio-scsi: harden virtio_scsi_load_request() against invalid stream Laurent Vivier
2026-07-25 15:34 ` [PATCH 0/3] Harden virtio migration load paths against crafted streams Michael S. Tsirkin
2026-07-28 15:00 ` Kevin Wolf [this message]
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=amjEALq8-unXNAZS@redhat.com \
--to=kwolf@redhat.com \
--cc=amit@kernel.org \
--cc=fam@euphon.net \
--cc=hreitz@redhat.com \
--cc=lvivier@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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.