summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2026-08-28 11:55:21 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-09-02 14:26:42 +0200
commit4f2d1151421520d7ae16ca8d367d0ca09f5dfbd7 (patch)
treefc5b46d9c123565316dd82424591a273dc40a04d
parentadd98959b220935b243170214c787bc03044a44d (diff)
downloadlinux-stable-4f2d1151421520d7ae16ca8d367d0ca09f5dfbd7.tar.gz
linux-stable-4f2d1151421520d7ae16ca8d367d0ca09f5dfbd7.zip
ipvs: reload ip header after head reallocation
commit a2f57827bf7c695b8c72dc4511cae8e86582369d upstream. __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> [Denis Arefev: adapted for 5.10/6.1: keep EnterFunction/LeaveFunction instrumentation] Signed-off-by: Denis Arefev <arefev@swemel.ru> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--net/netfilter/ipvs/ip_vs_xmit.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
index 9e199f00eea7..40a1d31b4054 100644
--- a/net/netfilter/ipvs/ip_vs_xmit.c
+++ b/net/netfilter/ipvs/ip_vs_xmit.c
@@ -718,15 +718,13 @@ 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);
-
EnterFunction(10);
- 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;