Skip to content

Commit ed30e07

Browse files
Florian Westphalgregkh
authored andcommitted
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>
1 parent 6bc803b commit ed30e07

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

net/netfilter/x_tables.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,9 @@ int xt_check_entry_offsets(const void *base,
567567
return -EINVAL;
568568

569569
t = (void *)(e + target_offset);
570+
if (t->u.target_size < sizeof(*t))
571+
return -EINVAL;
572+
570573
if (target_offset + t->u.target_size > next_offset)
571574
return -EINVAL;
572575

0 commit comments

Comments
 (0)