]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net/sched: act_csum: don't mangle UDP tunnel GSO packets
authorAlice Mikityanska <alice@isovalent.com>
Thu, 11 Jun 2026 19:29:45 +0000 (21:29 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Sun, 14 Jun 2026 11:27:39 +0000 (13:27 +0200)
Similar to commit add641e7dee3 ("sched: act_csum: don't mangle TCP and
UDP GSO packets"), UDP tunnel GSO packets going through act_csum
shouldn't have their checksum calculated at this point, because it will
be done after segmentation. Setting the checksum in act_csum modifies
skb->ip_summed and prevents inner IP csum offload from kicking in,
resulting in a packet with a bad checksum.

Add UDP tunnel GSO packets to the exceptions, and also add UDP GSO
(SKB_GSO_UDP_L4), as the same logic as in the commit mentioned above
applies to UDP GSO too.

Signed-off-by: Alice Mikityanska <alice@isovalent.com>
Reviewed-by: Davide Caratti <dcaratti@redhat.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20260611192955.604661-2-alice.kernel@fastmail.im
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/sched/act_csum.c

index a9e4635d899e387884f21df981051cdaf2bad437..078d3a27130b8de921ae722d4315ba39c8d3433b 100644 (file)
@@ -259,7 +259,9 @@ static int tcf_csum_ipv4_udp(struct sk_buff *skb, unsigned int ihl,
        const struct iphdr *iph;
        u16 ul;
 
-       if (skb_is_gso(skb) && skb_shinfo(skb)->gso_type & SKB_GSO_UDP)
+       if (skb_is_gso(skb) && skb_shinfo(skb)->gso_type &
+           (SKB_GSO_UDP | SKB_GSO_UDP_L4 |
+            SKB_GSO_UDP_TUNNEL | SKB_GSO_UDP_TUNNEL_CSUM))
                return 1;
 
        /*
@@ -315,7 +317,9 @@ static int tcf_csum_ipv6_udp(struct sk_buff *skb, unsigned int ihl,
        const struct ipv6hdr *ip6h;
        u16 ul;
 
-       if (skb_is_gso(skb) && skb_shinfo(skb)->gso_type & SKB_GSO_UDP)
+       if (skb_is_gso(skb) && skb_shinfo(skb)->gso_type &
+           (SKB_GSO_UDP | SKB_GSO_UDP_L4 |
+            SKB_GSO_UDP_TUNNEL | SKB_GSO_UDP_TUNNEL_CSUM))
                return 1;
 
        /*