]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ipvs: clear IPv4 options after rebasing tunnel ICMP errors
authorKyle Zeng <kylebot@openai.com>
Tue, 4 Aug 2026 06:10:55 +0000 (06:10 +0000)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 10 Aug 2026 18:27:07 +0000 (20:27 +0200)
commite0ba936287dfe9783426aac27e5fd76fe35b38c9
treeae64438b36f431297f454799b1e4cf358709560f
parent33d1469b0124cc0baaea7a2032123b77a81e0940
ipvs: clear IPv4 options after rebasing tunnel ICMP errors

ip_vs_in_icmp() rebases an skb from the outer ICMP packet to the
quoted original request before passing it to icmp_send(). However,
IPCB(skb)->opt still describes the outer IPv4 header.

A timestamp option in the outer header can therefore leave an offset
that points into the quoted transport header after the rebase.
__ip_options_echo() treats a byte at that stale location as the option
length and copies it into the fixed-size option storage on the
__icmp_send() stack, causing a stack out-of-bounds write.

Clear the stale option metadata after resetting the network header.
Keep the remaining control block fields, including the ingress
interface used by the ICMP response path.

Fixes: f2edb9f7706d ("ipvs: implement passive PMTUD for IPIP packets")
Cc: stable@vger.kernel.org
Assisted-by: Codex:gpt-5.6-sol Codex:gpt-5.5-cyber
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Co-developed-by: David Lee <david.lee@trailofbits.com>
Signed-off-by: David Lee <david.lee@trailofbits.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/ipvs/ip_vs_core.c