mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 14:19:16 +00:00
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>
This commit is contained in:
parent
aa412ba225
commit
a08e4e190b
1 changed files with 3 additions and 0 deletions
|
@ -568,6 +568,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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue