]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 24 Jul 2025 06:56:33 +0000 (08:56 +0200)
[ Upstream commit 9f735b6f8a77d7be7f8b0765dc93587774832cb1 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv4/tcp_offload.c
net/ipv4/udp_offload.c

index e04ebe651c334707f90435ba08375912c860d7c3..3a9c5c14c310ed6d6f898af3245575e31e2f7f03 100644 (file)
@@ -355,6 +355,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 845730184c5d3163f2e23996e6fd0ac4a0bdde3e..5de47dd5e9093d0de0b0458ca472b50fbfe15a7d 100644 (file)
@@ -604,6 +604,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,