netfilter: x_tables: validate e->target_offset early
authorFlorian Westphal <fw@strlen.de>
Tue, 22 Mar 2016 17:02:49 +0000 (18:02 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 21 Aug 2016 15:26:12 +0000 (17:26 +0200)
commit0608074c2c1fd874b10117c07b2751d2477bec14
tree4cc62a7e528733ffca5bd09deeb173ef6046fa81
parent2d2bec8f2fc546020e9b15d388ce23d6a00b0b38
netfilter: x_tables: validate e->target_offset early

commit bdf533de6968e9686df777dc178486f600c6e617 upstream.

We should check that e->target_offset is sane before
mark_source_chains gets called since it will fetch the target entry
for loop detection.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
net/ipv4/netfilter/arp_tables.c
net/ipv4/netfilter/ip_tables.c
net/ipv6/netfilter/ip6_tables.c