From: "Michael S. Tsirkin" <mst@redhat.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: Jonah Palmer <jonah.palmer@oracle.com>,
qemu-devel@nongnu.org, eperezma@redhat.com, jasowang@redhat.com,
si-wei.liu@oracle.com, boris.ostrovsky@oracle.com,
terrynini38514@gmail.com, qemu-stable <qemu-stable@nongnu.org>
Subject: Re: [PATCH] virtio: fix off-by-one and invalid access in virtqueue_ordered_fill
Date: Fri, 1 Aug 2025 12:52:18 -0400 [thread overview]
Message-ID: <20250801125210-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <0f0e8785-cee4-4cab-b91a-fdcca51b73de@tls.msk.ru>
On Fri, Aug 01, 2025 at 06:46:09PM +0300, Michael Tokarev wrote:
> On 21.07.2025 18:02, Jonah Palmer wrote:
> > Commit b44135daa372 introduced virtqueue_ordered_fill for
> > VIRTIO_F_IN_ORDER support but had a few issues:
> >
> > * Conditional while loop used 'steps <= max_steps' but should've been
> > 'steps < max_steps' since reaching steps == max_steps would indicate
> > that we didn't find an element, which is an error. Without this
> > change, the code would attempt to read invalid data at an index
> > outside of our search range.
> >
> > * Incremented 'steps' using the next chain's ndescs instead of the
> > current one.
> >
> > This patch corrects the loop bounds and synchronizes 'steps' and index
> > increments.
> >
> > We also add a defensive sanity check against malicious or invalid
> > descriptor counts to avoid a potential infinite loop and DoS.
> >
> > Fixes: b44135daa372 ("virtio: virtqueue_ordered_fill - VIRTIO_F_IN_ORDER support")
>
> This looks like a good candidate for qemu-stable, isn't it?
>
> Thanks,
>
> /mjt
indeed.
prev parent reply other threads:[~2025-08-01 18:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-21 15:02 [PATCH] virtio: fix off-by-one and invalid access in virtqueue_ordered_fill Jonah Palmer
2025-07-22 22:20 ` Si-Wei Liu
2025-07-23 5:55 ` Jason Wang
2025-08-01 15:46 ` Michael Tokarev
2025-08-01 16:52 ` Michael S. Tsirkin [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=20250801125210-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=boris.ostrovsky@oracle.com \
--cc=eperezma@redhat.com \
--cc=jasowang@redhat.com \
--cc=jonah.palmer@oracle.com \
--cc=mjt@tls.msk.ru \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=si-wei.liu@oracle.com \
--cc=terrynini38514@gmail.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.