]> www.infradead.org Git - users/jedix/linux-maple.git/commit
netfilter: x_tables: check standard target size too
authorFlorian Westphal <fw@strlen.de>
Fri, 1 Apr 2016 12:17:27 +0000 (14:17 +0200)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 30 Sep 2016 06:05:34 +0000 (23:05 -0700)
commit433a8c5a4d42daec294b6a17a61ba663a6a525f5
tree2427bc813cb393bdd0f8c2b76dab9575acb1db7b
parentf9523a979411f6ce1beecea933c1fa1f2878a155
netfilter: x_tables: check standard target size too

Orabug: 24690280
CVE: CVE-2016-3134

[ Upstream commit 7ed2abddd20cf8f6bd27f65bd218f26fa5bf7f44 ]

We have targets and standard targets -- the latter carries a verdict.

The ip/ip6tables validation functions will access t->verdict for the
standard targets to fetch the jump offset or verdict for chainloop
detection, but this happens before the targets get checked/validated.

Thus we also need to check for verdict presence here, else t->verdict
can point right after a blob.

Spotted with UBSAN while testing malformed blobs.

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>
(cherry picked from commit 73bfda1c492bef7038a87adfa887b7e6b7cd6679)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
net/netfilter/x_tables.c