]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ipvs: avoid out-of-bounds write in ip_vs_nat_icmp
authorJulian Anastasov <ja@ssi.bg>
Thu, 30 Jul 2026 18:35:05 +0000 (21:35 +0300)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 31 Jul 2026 13:58:16 +0000 (15:58 +0200)
commit646922a0379496154e8c8faca4f8e2fd9100cacc
tree5bbf2ddb1f70b3fabe649ed853982f6279f7981f
parent7defddefa95b3699b05b23bf3ceea94d872509bb
ipvs: avoid out-of-bounds write in ip_vs_nat_icmp

Sashiko warns that local attacker can modify the packet
while it is processed by IPVS. Some places read the
IP ihl field multiple times which can cause out-of-bounds
access. One such place is ip_vs_nat_icmp where we
can write after the validated area.

Fix it by providing ciph argument just like it is done for
IPv6 and use ciph->len as offset to the embedded transport
header.

Modify some IPv4 header checks by reading the ihl field
only once.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Link: https://sashiko.dev/#/patchset/20260722101517.36313-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