diff options
author | Florian Westphal <fw@strlen.de> | 2016-04-01 14:17:25 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-24 10:18:23 -0700 |
commit | ed30e07de077354993122c5d88e535cbe0a03754 (patch) | |
tree | e9f41de97c1c4247514fa04d58bf1fdb63971459 /net/netfilter | |
parent | 6bc803b795631cb14a6a3ea6d433589c8c666cc3 (diff) | |
download | linux-stable-ed30e07de077354993122c5d88e535cbe0a03754.tar.gz linux-stable-ed30e07de077354993122c5d88e535cbe0a03754.tar.bz2 linux-stable-ed30e07de077354993122c5d88e535cbe0a03754.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>
Diffstat (limited to 'net/netfilter')
-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 24a9dfb51df2..e3e2dd4c55bf 100644 --- a/net/netfilter/x_tables.c +++ b/net/netfilter/x_tables.c @@ -567,6 +567,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; |