virtio-net: zero unused hash fields
Subsystems (5)
PATCH v2 1/1 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.
--- include/linux/virtio_net.h | 4 ++++ 1 file changed, 4 insertions(+)
include/linux/virtio_net.h +4 -0
@@ -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 ; +/* 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);
Signature · 1 line
2.42.0
Quoted 4 lines · Jason Wang
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.
Quoted 27 lines
Fixes a2fb4bc4e2a6a ("net: implement virtio helpers to handle UDP GSO tunneling")Cc <[email protected]>Signed-off-by Jason Wang <[email protected]>--- include/linux/virtio_net.h | 4 ++++ 1 file changed, 4 insertions(+)include/linux/virtio_net.h +4
-1@@ -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 ; +/* 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
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 11 lines · On Wed, 22 Oct 2025 11:44:21 +0800 you 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")Cc <[email protected]>Signed-off-by Jason Wang <[email protected]>[...]
Here is the summary with links:
- [net,V2] virtio-net: zero unused hash fields
https://git.kernel.org/netdev/net/c/b2284768c6b3
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html