]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ipvs: revalidate ihl to prevent out-of-bounds access
authorJulian Anastasov <ja@ssi.bg>
Thu, 6 Aug 2026 10:52:11 +0000 (13:52 +0300)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 10 Aug 2026 18:27:15 +0000 (20:27 +0200)
commitd93660df4dd1d116f608ada4a29a80a5d6f0a6ed
treec08d3af4fc991c485b541355318fd6f6ddf5050d
parente0ba936287dfe9783426aac27e5fd76fe35b38c9
ipvs: revalidate ihl to prevent out-of-bounds access

While the outer IP header is already pulled into the skb head,
we must be careful and revalidate the embedded headers after
reading them from the skb frags to prevent out-of-bounds
access.

One such place reported by Sashiko is ip_vs_nat_icmp() where
local process can change the ihl field and after
skb_ensure_writable() we can see larger value which is a
problem for the ip_send_check(cih) calls.

Add check to drop the packet if the ihl field is changed.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Link: https://sashiko.dev/#/patchset/20260730183506.87473-1-ja%40ssi.bg
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/ip_vs.h
net/netfilter/ipvs/ip_vs_core.c
net/netfilter/ipvs/ip_vs_xmit.c