Commit a08e4e19 authored by Florian Westphal's avatar Florian Westphal Committed by Pablo Neira Ayuso

netfilter: x_tables: assert minimum target size

The target size includes the size of the xt_entry_target struct.
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent aa412ba2
...@@ -568,6 +568,9 @@ int xt_check_entry_offsets(const void *base, ...@@ -568,6 +568,9 @@ int xt_check_entry_offsets(const void *base,
return -EINVAL; return -EINVAL;
t = (void *)(e + target_offset); t = (void *)(e + target_offset);
if (t->u.target_size < sizeof(*t))
return -EINVAL;
if (target_offset + t->u.target_size > next_offset) if (target_offset + t->u.target_size > next_offset)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment