]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
netfilter: x_tables: don't move to non-existent next rule
authorFlorian Westphal <fw@strlen.de>
Thu, 23 Jun 2016 18:32:17 +0000 (19:32 +0100)
committerBrad Figg <brad.figg@canonical.com>
Fri, 24 Jun 2016 01:20:29 +0000 (18:20 -0700)
commit4654741d059b9c31c749b5c49d7d7f8d896c051a
tree72d3cede72d23bc1f2f4063b74f4c1dc12ee39f4
parent426cebe4f7bf8f98649fdee7759d29ff5de47f50
netfilter: x_tables: don't move to non-existent next rule

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>
(cherry picked from commit f24e230d257af1ad7476c6e81a8dc3127a74204e)
BugLink: https://bugs.launchpad.net/bugs/1595350
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Brad Figg <brad.figg@canonical.com>
net/ipv4/netfilter/arp_tables.c
net/ipv4/netfilter/ip_tables.c
net/ipv6/netfilter/ip6_tables.c