Skip to content

Commit b228476

Browse files
jasowangkuba-moo
authored andcommitted
virtio-net: zero unused hash fields
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. Acked-by: Michael S. Tsirkin <mst@redhat.com> Fixes: a2fb4bc ("net: implement virtio helpers to handle UDP GSO tunneling") Cc: <stable@vger.kernel.org> Signed-off-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com> Link: https://patch.msgid.link/20251022034421.70244-1-jasowang@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 399d109 commit b228476

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

include/linux/virtio_net.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,10 @@ virtio_net_hdr_tnl_from_skb(const struct sk_buff *skb,
401401
if (!tnl_hdr_negotiated)
402402
return -EINVAL;
403403

404+
vhdr->hash_hdr.hash_value = 0;
405+
vhdr->hash_hdr.hash_report = 0;
406+
vhdr->hash_hdr.padding = 0;
407+
404408
/* Let the basic parsing deal with plain GSO features. */
405409
skb_shinfo(skb)->gso_type &= ~tnl_gso_type;
406410
ret = virtio_net_hdr_from_skb(skb, hdr, true, false, vlan_hlen);

0 commit comments

Comments
 (0)