diff options
author | Florian Westphal <fw@strlen.de> | 2016-04-01 08:17:25 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-04-13 18:30:36 -0400 |
commit | a08e4e190b866579896c09af59b3bdca821da2cd (patch) | |
tree | 49a3ba3531cc49130ba5d5a9eb363c7bc8919310 /net/netfilter | |
parent | aa412ba225dd3bc36d404c28cdc3d674850d80d0 (diff) |
netfilter: x_tables: assert minimum target size
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>
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 1f44bfa8dd94..ec1b7183fff9 100644 --- a/net/netfilter/x_tables.c +++ b/net/netfilter/x_tables.c | |||
@@ -568,6 +568,9 @@ int xt_check_entry_offsets(const void *base, | |||
568 | return -EINVAL; | 568 | return -EINVAL; |
569 | 569 | ||
570 | t = (void *)(e + target_offset); | 570 | t = (void *)(e + target_offset); |
571 | if (t->u.target_size < sizeof(*t)) | ||
572 | return -EINVAL; | ||
573 | |||
571 | if (target_offset + t->u.target_size > next_offset) | 574 | if (target_offset + t->u.target_size > next_offset) |
572 | return -EINVAL; | 575 | return -EINVAL; |
573 | 576 | ||