Skip to content

Commit b625d23

Browse files
jasowanggregkh
authored andcommitted
virtio-net: zero unused hash fields
commit b228476 upstream. 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 <[email protected]> Fixes: a2fb4bc ("net: implement virtio helpers to handle UDP GSO tunneling") Cc: <[email protected]> Signed-off-by: Jason Wang <[email protected]> Reviewed-by: Xuan Zhuo <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f784c10 commit b625d23

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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)