summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2016-04-01 14:17:25 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-06-24 10:15:30 -0700
commit412f0324bf5f7d719ee0cf8d9610745b1a11cb7b (patch)
tree9c9a7418ebbddba71502e5e6976adddb9a1b3202
parentc7118d93d1a761b156e282bce9d11850eec7ac3b (diff)
downloadlwn-412f0324bf5f7d719ee0cf8d9610745b1a11cb7b.tar.gz
lwn-412f0324bf5f7d719ee0cf8d9610745b1a11cb7b.zip
netfilter: x_tables: assert minimum target size
commit a08e4e190b866579896c09af59b3bdca821da2cd upstream. 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/netfilter/x_tables.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index 2ad520ccd006..1e2ff82d5bf7 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -587,6 +587,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;