Patch "sit: update dev->needed_headroom in ipip6_tunnel_bind_dev()" has been added to the 4.14-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    sit: update dev->needed_headroom in ipip6_tunnel_bind_dev()

to the 4.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     sit-update-dev-needed_headroom-in-ipip6_tunnel_bind_.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit fa5777d371ad64ae42805138b3a055d0bcfd0e09
Author: Cong Wang <cong.wang@xxxxxxxxxxxxx>
Date:   Wed Apr 26 23:00:06 2023 -0700

    sit: update dev->needed_headroom in ipip6_tunnel_bind_dev()
    
    [ Upstream commit c88f8d5cd95fd039cff95d682b8e71100c001df0 ]
    
    When a tunnel device is bound with the underlying device, its
    dev->needed_headroom needs to be updated properly. IPv4 tunnels
    already do the same in ip_tunnel_bind_dev(). Otherwise we may
    not have enough header room for skb, especially after commit
    b17f709a2401 ("gue: TX support for using remote checksum offload option").
    
    Fixes: 32b8a8e59c9c ("sit: add IPv4 over IPv4 support")
    Reported-by: Palash Oswal <oswalpalash@xxxxxxxxx>
    Link: https://lore.kernel.org/netdev/CAGyP=7fDcSPKu6nttbGwt7RXzE3uyYxLjCSE97J64pRxJP8jPA@xxxxxxxxxxxxxx/
    Cc: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx>
    Cc: Eric Dumazet <edumazet@xxxxxxxxxx>
    Signed-off-by: Cong Wang <cong.wang@xxxxxxxxxxxxx>
    Reviewed-by: Eric Dumazet <edumazet@xxxxxxxxxx>
    Reviewed-by: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index e5baf5e4782b0..f24a6cd0d15a3 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -1039,12 +1039,13 @@ static netdev_tx_t sit_tunnel_xmit(struct sk_buff *skb,
 
 static void ipip6_tunnel_bind_dev(struct net_device *dev)
 {
+	struct ip_tunnel *tunnel = netdev_priv(dev);
+	int t_hlen = tunnel->hlen + sizeof(struct iphdr);
 	struct net_device *tdev = NULL;
-	struct ip_tunnel *tunnel;
+	int hlen = LL_MAX_HEADER;
 	const struct iphdr *iph;
 	struct flowi4 fl4;
 
-	tunnel = netdev_priv(dev);
 	iph = &tunnel->parms.iph;
 
 	if (iph->daddr) {
@@ -1067,14 +1068,15 @@ static void ipip6_tunnel_bind_dev(struct net_device *dev)
 		tdev = __dev_get_by_index(tunnel->net, tunnel->parms.link);
 
 	if (tdev && !netif_is_l3_master(tdev)) {
-		int t_hlen = tunnel->hlen + sizeof(struct iphdr);
 		int mtu;
 
 		mtu = tdev->mtu - t_hlen;
 		if (mtu < IPV6_MIN_MTU)
 			mtu = IPV6_MIN_MTU;
 		WRITE_ONCE(dev->mtu, mtu);
+		hlen = tdev->hard_header_len + tdev->needed_headroom;
 	}
+	dev->needed_headroom = t_hlen + hlen;
 }
 
 static void ipip6_tunnel_update(struct ip_tunnel *t, struct ip_tunnel_parm *p,



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux