]> git.ipfire.org Git - people/arne_f/kernel.git/commit
netfilter: x_tables: don't move to non-existent next rule
authorFlorian Westphal <fw@strlen.de>
Fri, 1 Apr 2016 12:17:21 +0000 (14:17 +0200)
committerSasha Levin <sasha.levin@oracle.com>
Mon, 11 Jul 2016 03:07:32 +0000 (23:07 -0400)
commitcf756388f8f34e02a338356b3685c46938139871
treebc466e005c0391a306df45dc7c48f2371c48dede
parent850c377e0e2d76723884d610ff40827d26aa21eb
netfilter: x_tables: don't move to non-existent next rule

[ Upstream commit f24e230d257af1ad7476c6e81a8dc3127a74204e ]

Ben Hawkes says:

 In the mark_source_chains function (net/ipv4/netfilter/ip_tables.c) it
 is possible for a user-supplied ipt_entry structure to have a large
 next_offset field. This field is not bounds checked prior to writing a
 counter value at the supplied offset.

Base chains enforce absolute verdict.

User defined chains are supposed to end with an unconditional return,
xtables userspace adds them automatically.

But if such return is missing we will move to non-existent next rule.

Reported-by: Ben Hawkes <hawkes@google.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
net/ipv4/netfilter/arp_tables.c
net/ipv4/netfilter/ip_tables.c
net/ipv6/netfilter/ip6_tables.c