From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: qemu-devel@nongnu.org, Akihiko Odaki <akihiko.odaki@daynix.com>,
Zhibin Hu <huzhibin5@huawei.com>,
qemu-stable@nongnu.org, "Michael S . Tsirkin" <mst@redhat.com>
Subject: Re: [PULL 2/8] virtio-net: Ensure queue index fits with RSS
Date: Tue, 6 Aug 2024 14:30:34 +0100 [thread overview]
Message-ID: <ZrIlej6y0fTLZ_JZ@redhat.com> (raw)
In-Reply-To: <20240802031929.44060-3-jasowang@redhat.com>
On Fri, Aug 02, 2024 at 11:19:23AM +0800, Jason Wang wrote:
> From: Akihiko Odaki <akihiko.odaki@daynix.com>
>
> Ensure the queue index points to a valid queue when software RSS
> enabled. The new calculation matches with the behavior of Linux's TAP
> device with the RSS eBPF program.
>
> Fixes: 4474e37a5b3a ("virtio-net: implement RX RSS processing")
> Reported-by: Zhibin Hu <huzhibin5@huawei.com>
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
> hw/net/virtio-net.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
FYI, this patch is the fix for CVE-2024-6505.
Please make sure to mention CVE assignments in the commit message
when one is available.
>
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index 8f30972708..5635620a31 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -1905,7 +1905,8 @@ static ssize_t virtio_net_receive_rcu(NetClientState *nc, const uint8_t *buf,
> if (!no_rss && n->rss_data.enabled && n->rss_data.enabled_software_rss) {
> int index = virtio_net_process_rss(nc, buf, size, &extra_hdr);
> if (index >= 0) {
> - NetClientState *nc2 = qemu_get_subqueue(n->nic, index);
> + NetClientState *nc2 =
> + qemu_get_subqueue(n->nic, index % n->curr_queue_pairs);
> return virtio_net_receive_rcu(nc2, buf, size, true);
> }
> }
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2024-08-06 13:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-02 3:19 [PULL 0/8] Net patches Jason Wang
2024-08-02 3:19 ` [PULL 1/8] rtl8139: Fix behaviour for old kernels Jason Wang
2024-08-02 3:19 ` [PULL 2/8] virtio-net: Ensure queue index fits with RSS Jason Wang
2024-08-06 13:30 ` Daniel P. Berrangé [this message]
2024-08-02 3:19 ` [PULL 3/8] virtio-net: Fix network stall at the host side waiting for kick Jason Wang
2024-08-02 3:19 ` [PULL 4/8] net: update netdev stream/dgram man page Jason Wang
2024-08-02 3:19 ` [PULL 5/8] net: update netdev stream man page with unix socket Jason Wang
2024-08-02 3:19 ` [PULL 6/8] net: update netdev dgram " Jason Wang
2024-08-02 3:19 ` [PULL 7/8] net: update netdev stream man page with the reconnect parameter Jason Wang
2024-08-02 3:19 ` [PULL 8/8] net: Reinstate '-net nic, model=help' output as documented in man page Jason Wang
2024-08-02 9:48 ` [PULL 0/8] Net patches Richard Henderson
2024-08-05 2:38 ` Jason Wang
2024-08-05 22:00 ` Richard Henderson
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=ZrIlej6y0fTLZ_JZ@redhat.com \
--to=berrange@redhat.com \
--cc=akihiko.odaki@daynix.com \
--cc=huzhibin5@huawei.com \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
/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.