From: Simon Horman <horms@kernel.org>
To: Jason Wang <jasowang@redhat.com>
Cc: mst@redhat.com, xuanzhuo@linux.alibaba.com, eperezma@redhat.com,
pabeni@redhat.com, virtualization@lists.linux.dev,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH net] virtio-net: zero unused hash fields
Date: Tue, 21 Oct 2025 12:17:09 +0100 [thread overview]
Message-ID: <aPdrtbW-n3RIFbDo@horms.kernel.org> (raw)
In-Reply-To: <20251021040155.47707-1-jasowang@redhat.com>
On Tue, Oct 21, 2025 at 12:01:55PM +0800, Jason Wang wrote:
> When GSO tunnel is negotiated virtio_net_hdr_tnl_from_skb() tries to
> initialize the tunnel metadata but forget to zero unused rxhash
> fields. This may leak information to another side. Fixing this by
> zeroing the unused hash fields.
>
> Fixes: a2fb4bc4e2a6a ("net: implement virtio helpers to handle UDP GSO tunneling")x
nit: there is a stray 'x' at the end of the line above
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
> include/linux/virtio_net.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
> index 20e0584db1dd..4d1780848d0e 100644
> --- a/include/linux/virtio_net.h
> +++ b/include/linux/virtio_net.h
> @@ -401,6 +401,10 @@ virtio_net_hdr_tnl_from_skb(const struct sk_buff *skb,
> if (!tnl_hdr_negotiated)
> return -EINVAL;
>
> + vhdr->hash_hdr.hash_value = 0;
> + vhdr->hash_hdr.hash_report = 0;
> + vhdr->hash_hdr.padding = 0;
> +
nit: The indentation seems off, probably a spaces vs tabs issue
> /* Let the basic parsing deal with plain GSO features. */
> skb_shinfo(skb)->gso_type &= ~tnl_gso_type;
> ret = virtio_net_hdr_from_skb(skb, hdr, true, false, vlan_hlen);
> --
> 2.42.0
>
>
prev parent reply other threads:[~2025-10-21 11:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-21 4:01 [PATCH net] virtio-net: zero unused hash fields Jason Wang
2025-10-21 8:28 ` Michael S. Tsirkin
2025-10-22 3:41 ` Jason Wang
2025-10-21 11:17 ` Simon Horman [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=aPdrtbW-n3RIFbDo@horms.kernel.org \
--to=horms@kernel.org \
--cc=eperezma@redhat.com \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.org \
--cc=virtualization@lists.linux.dev \
--cc=xuanzhuo@linux.alibaba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).