diff options
author | Florian Westphal <fw@strlen.de> | 2016-04-01 14:17:25 +0200 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2016-07-12 08:48:31 -0400 |
commit | 37a6fed6bcd018561cf18ddef42f6f6e106b220e (patch) | |
tree | 88731c424378aa11a758ba8386d83bacb454baa4 | |
parent | dda467549d44f4d39b4420511ddcf77d29e9b6b2 (diff) | |
download | linux-stable-37a6fed6bcd018561cf18ddef42f6f6e106b220e.tar.gz linux-stable-37a6fed6bcd018561cf18ddef42f6f6e106b220e.tar.bz2 linux-stable-37a6fed6bcd018561cf18ddef42f6f6e106b220e.zip |
netfilter: x_tables: assert minimum target size
[ 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>
-rw-r--r-- | net/netfilter/x_tables.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c index d846b52a6fc0..f432ee7e4d6d 100644 --- a/net/netfilter/x_tables.c +++ b/net/netfilter/x_tables.c @@ -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; |