]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ipvs: reload ip header after head reallocation
authorFlorian Westphal <fw@strlen.de>
Wed, 8 Jul 2026 14:21:30 +0000 (16:21 +0200)
committerFlorian Westphal <fw@strlen.de>
Fri, 10 Jul 2026 14:28:47 +0000 (16:28 +0200)
__ip_vs_get_out_rt() calls skb_ensure_writable() which may
reallocate skb->head.

Fixes: 8d8e20e2d7bb ("ipvs: Decrement ttl")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-sonnet-4-6
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Florian Westphal <fw@strlen.de>
net/netfilter/ipvs/ip_vs_xmit.c

index ce542ed4b013c82849e9fe508250a2c601d68617..9fef4335da13fd3a134a8d0807aedd0a6d143d19 100644 (file)
@@ -736,13 +736,11 @@ int
 ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
                  struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)
 {
-       struct iphdr  *iph = ip_hdr(skb);
-
-       if (__ip_vs_get_out_rt(cp->ipvs, cp->af, skb, NULL, iph->daddr,
+       if (__ip_vs_get_out_rt(cp->ipvs, cp->af, skb, NULL, ip_hdr(skb)->daddr,
                               IP_VS_RT_MODE_NON_LOCAL, NULL, ipvsh) < 0)
                goto tx_error;
 
-       ip_send_check(iph);
+       ip_send_check(ip_hdr(skb));
 
        /* Another hack: avoid icmp_send in ip_fragment */
        skb->ignore_df = 1;