]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: fix segmentation after TCP/UDP fraglist GRO
authorFelix Fietkau <nbd@nbd.name>
Sat, 5 Jul 2025 15:06:21 +0000 (17:06 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 17 Jul 2025 08:01:02 +0000 (10:01 +0200)
Since "net: gro: use cb instead of skb->network_header", the skb network
header is no longer set in the GRO path.
This breaks fraglist segmentation, which relies on ip_hdr()/tcp_hdr()
to check for address/port changes.
Fix this regression by selectively setting the network header for merged
segment skbs.

Fixes: 186b1ea73ad8 ("net: gro: use cb instead of skb->network_header")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20250705150622.10699-1-nbd@nbd.name
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/ipv4/tcp_offload.c
net/ipv4/udp_offload.c

index d293087b426df79b2e7bd3597de85edfb8c90cec..be5c2294610e5bab2aac7cbf5288e3f53fec358f 100644 (file)
@@ -359,6 +359,7 @@ struct sk_buff *tcp_gro_receive(struct list_head *head, struct sk_buff *skb,
                flush |= skb->ip_summed != p->ip_summed;
                flush |= skb->csum_level != p->csum_level;
                flush |= NAPI_GRO_CB(p)->count >= 64;
+               skb_set_network_header(skb, skb_gro_receive_network_offset(skb));
 
                if (flush || skb_gro_receive_list(p, skb))
                        mss = 1;
index 85b5aa82d7d74a945d9139f7f94042d2c0f937bc..e0a6bfa95118acd49ab2108e3c69a7e585c9032d 100644 (file)
@@ -767,6 +767,7 @@ static struct sk_buff *udp_gro_receive_segment(struct list_head *head,
                                        NAPI_GRO_CB(skb)->flush = 1;
                                        return NULL;
                                }
+                               skb_set_network_header(skb, skb_gro_receive_network_offset(skb));
                                ret = skb_gro_receive_list(p, skb);
                        } else {
                                skb_gro_postpull_rcsum(skb, uh,