virtio-net: zero unused hash fields
Subsystems (5)
PATCH 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 8 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.Fixes a2fb4bc4e2a6a ("net: implement virtio helpers to handle UDP GSO tunneling")xCc <[email protected]>Signed-off-by Jason Wang <[email protected]>
Quoted 21 lines
--- 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
Simon Horman
reviewerQuoted 6 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.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
Quoted 11 lines
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 +0
-0
include/linux/virtio_net.h virtio_net_hdr_tnl_from_skb(const struct sk_buff *skb, · line 407
Quoted 7 lines
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 ; +
nit: The indentation seems off, probably a spaces vs tabs issue
Quoted 7 lines
include/linux/virtio_net.h +0
-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 8 lines · Michael S. Tsirkin
Quoted 6 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.Fixes a2fb4bc4e2a6a ("net: implement virtio helpers to handle UDP GSO tunneling")x
I just spotted this has an unnecessary trailing 'x'. Will post V2.
Quoted 4 lines
Quoted 2 lines
Cc <[email protected]>Signed-off-by Jason Wang <[email protected]>
Thanks