]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
netfilter: x_tables: guard option walkers against 1-byte tail reads
authorDavid Dull <monderasdor@gmail.com>
Sat, 7 Mar 2026 18:26:21 +0000 (20:26 +0200)
committerFlorian Westphal <fw@strlen.de>
Tue, 10 Mar 2026 13:10:42 +0000 (14:10 +0100)
commitcfe770220ac2dbd3e104c6b45094037455da81d4
treeb49b7c5c4f34bea55f5d1fab58914cc71ea086d6
parentd6d8cd2db236a9dd13dbc2d05843b3445cc964b5
netfilter: x_tables: guard option walkers against 1-byte tail reads

When the last byte of options is a non-single-byte option kind, walkers
that advance with i += op[i + 1] ? : 1 can read op[i + 1] past the end
of the option area.

Add an explicit i == optlen - 1 check before dereferencing op[i + 1]
in xt_tcpudp and xt_dccp option walkers.

Fixes: 2e4e6a17af35 ("[NETFILTER] x_tables: Abstraction layer for {ip,ip6,arp}_tables")
Signed-off-by: David Dull <monderasdor@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
net/netfilter/xt_dccp.c
net/netfilter/xt_tcpudp.c