]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
netfilter: x_tables: assert minimum target size
authorFlorian Westphal <fw@strlen.de>
Fri, 1 Apr 2016 12:17:25 +0000 (14:17 +0200)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 30 Sep 2016 06:05:23 +0000 (23:05 -0700)
Orabug: 24690280
CVE: CVE-2016-3134

[ Upstream commit a08e4e190b866579896c09af59b3bdca821da2cd ]

The target size includes the size of the xt_entry_target struct.

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 aae91919c9d6d1aa6d6390826979e6d2c89a7ba4)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
net/netfilter/x_tables.c

index 7540522a8d2714b7e8e82b34dabbe5d842550b1d..cdee456f48d14de558298424e70297cc9469a67c 100644 (file)
@@ -570,6 +570,9 @@ int xt_check_entry_offsets(const void *base,
                return -EINVAL;
 
        t = (void *)(e + target_offset);
+       if (t->u.target_size < sizeof(*t))
+               return -EINVAL;
+
        if (target_offset + t->u.target_size > next_offset)
                return -EINVAL;