Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 37a6fed6 authored by Florian Westphal's avatar Florian Westphal Committed by Sasha Levin
Browse files

netfilter: x_tables: assert minimum target size



[ Upstream commit a08e4e190b866579896c09af59b3bdca821da2cd ]

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>
Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
parent dda46754
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -570,6 +570,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;