浏览代码

Merge branch 'udp-gso-fixes'

Willem de Bruijn says:

====================
udp gso fixes

A few small fixes:
- disallow segmentation with XFRM
- do not leak gso packets into the ingress path

Changes
  v1 -> v2
  - fix build failure in team.c
  - drop scatter-gather fix:
      this is now fixed by commit 113f99c33585 ("net: test tailroom
      before appending to linear skb"). After this patch gso skbs are
      built non-linear regardless of NETIF_F_SG and skb_segment builds
      linear segs.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller 7 年之前
父节点
当前提交
75a839c34b
共有 5 个文件被更改,包括 10 次插入7 次删除
  1. 3 2
      drivers/net/bonding/bond_main.c
  2. 3 2
      drivers/net/team/team.c
  3. 0 1
      include/linux/netdev_features.h
  4. 2 1
      net/ipv4/udp.c
  5. 2 1
      net/ipv6/udp.c

+ 3 - 2
drivers/net/bonding/bond_main.c

@@ -1107,7 +1107,8 @@ static void bond_compute_features(struct bonding *bond)
 
 
 done:
 done:
 	bond_dev->vlan_features = vlan_features;
 	bond_dev->vlan_features = vlan_features;
-	bond_dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL;
+	bond_dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL |
+				    NETIF_F_GSO_UDP_L4;
 	bond_dev->gso_max_segs = gso_max_segs;
 	bond_dev->gso_max_segs = gso_max_segs;
 	netif_set_gso_max_size(bond_dev, gso_max_size);
 	netif_set_gso_max_size(bond_dev, gso_max_size);
 
 
@@ -4268,7 +4269,7 @@ void bond_setup(struct net_device *bond_dev)
 				NETIF_F_HW_VLAN_CTAG_RX |
 				NETIF_F_HW_VLAN_CTAG_RX |
 				NETIF_F_HW_VLAN_CTAG_FILTER;
 				NETIF_F_HW_VLAN_CTAG_FILTER;
 
 
-	bond_dev->hw_features |= NETIF_F_GSO_ENCAP_ALL;
+	bond_dev->hw_features |= NETIF_F_GSO_ENCAP_ALL | NETIF_F_GSO_UDP_L4;
 	bond_dev->features |= bond_dev->hw_features;
 	bond_dev->features |= bond_dev->hw_features;
 }
 }
 
 

+ 3 - 2
drivers/net/team/team.c

@@ -1026,7 +1026,8 @@ static void __team_compute_features(struct team *team)
 	}
 	}
 
 
 	team->dev->vlan_features = vlan_features;
 	team->dev->vlan_features = vlan_features;
-	team->dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL;
+	team->dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL |
+				     NETIF_F_GSO_UDP_L4;
 	team->dev->hard_header_len = max_hard_header_len;
 	team->dev->hard_header_len = max_hard_header_len;
 
 
 	team->dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
 	team->dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
@@ -2117,7 +2118,7 @@ static void team_setup(struct net_device *dev)
 			   NETIF_F_HW_VLAN_CTAG_RX |
 			   NETIF_F_HW_VLAN_CTAG_RX |
 			   NETIF_F_HW_VLAN_CTAG_FILTER;
 			   NETIF_F_HW_VLAN_CTAG_FILTER;
 
 
-	dev->hw_features |= NETIF_F_GSO_ENCAP_ALL;
+	dev->hw_features |= NETIF_F_GSO_ENCAP_ALL | NETIF_F_GSO_UDP_L4;
 	dev->features |= dev->hw_features;
 	dev->features |= dev->hw_features;
 }
 }
 
 

+ 0 - 1
include/linux/netdev_features.h

@@ -220,7 +220,6 @@ enum {
 				 NETIF_F_GSO_GRE_CSUM |			\
 				 NETIF_F_GSO_GRE_CSUM |			\
 				 NETIF_F_GSO_IPXIP4 |			\
 				 NETIF_F_GSO_IPXIP4 |			\
 				 NETIF_F_GSO_IPXIP6 |			\
 				 NETIF_F_GSO_IPXIP6 |			\
-				 NETIF_F_GSO_UDP_L4 |			\
 				 NETIF_F_GSO_UDP_TUNNEL |		\
 				 NETIF_F_GSO_UDP_TUNNEL |		\
 				 NETIF_F_GSO_UDP_TUNNEL_CSUM)
 				 NETIF_F_GSO_UDP_TUNNEL_CSUM)
 
 

+ 2 - 1
net/ipv4/udp.c

@@ -788,7 +788,8 @@ static int udp_send_skb(struct sk_buff *skb, struct flowi4 *fl4,
 			return -EINVAL;
 			return -EINVAL;
 		if (sk->sk_no_check_tx)
 		if (sk->sk_no_check_tx)
 			return -EINVAL;
 			return -EINVAL;
-		if (skb->ip_summed != CHECKSUM_PARTIAL || is_udplite)
+		if (skb->ip_summed != CHECKSUM_PARTIAL || is_udplite ||
+		    dst_xfrm(skb_dst(skb)))
 			return -EIO;
 			return -EIO;
 
 
 		skb_shinfo(skb)->gso_size = cork->gso_size;
 		skb_shinfo(skb)->gso_size = cork->gso_size;

+ 2 - 1
net/ipv6/udp.c

@@ -1053,7 +1053,8 @@ static int udp_v6_send_skb(struct sk_buff *skb, struct flowi6 *fl6,
 			return -EINVAL;
 			return -EINVAL;
 		if (udp_sk(sk)->no_check6_tx)
 		if (udp_sk(sk)->no_check6_tx)
 			return -EINVAL;
 			return -EINVAL;
-		if (skb->ip_summed != CHECKSUM_PARTIAL || is_udplite)
+		if (skb->ip_summed != CHECKSUM_PARTIAL || is_udplite ||
+		    dst_xfrm(skb_dst(skb)))
 			return -EIO;
 			return -EIO;
 
 
 		skb_shinfo(skb)->gso_size = cork->gso_size;
 		skb_shinfo(skb)->gso_size = cork->gso_size;