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

Commit af9d32ad authored by Holger Eitzenberger's avatar Holger Eitzenberger Committed by Patrick McHardy
Browse files

netfilter: limit the length of the helper name



This is necessary in order to have an upper bound for Netlink
message calculation, which is not a problem at all, as there
are no helpers with a longer name.

Signed-off-by: default avatarHolger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
parent e487eb99
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -14,6 +14,8 @@


struct module;
struct module;


#define NF_CT_HELPER_NAME_LEN	16

struct nf_conntrack_helper
struct nf_conntrack_helper
{
{
	struct hlist_node hnode;	/* Internal use. */
	struct hlist_node hnode;	/* Internal use. */
+1 −0
Original line number Original line Diff line number Diff line
@@ -142,6 +142,7 @@ int nf_conntrack_helper_register(struct nf_conntrack_helper *me)


	BUG_ON(me->expect_policy == NULL);
	BUG_ON(me->expect_policy == NULL);
	BUG_ON(me->expect_class_max >= NF_CT_MAX_EXPECT_CLASSES);
	BUG_ON(me->expect_class_max >= NF_CT_MAX_EXPECT_CLASSES);
	BUG_ON(strlen(me->name) > NF_CT_HELPER_NAME_LEN - 1);


	mutex_lock(&nf_ct_helper_mutex);
	mutex_lock(&nf_ct_helper_mutex);
	hlist_add_head_rcu(&me->hnode, &nf_ct_helper_hash[h]);
	hlist_add_head_rcu(&me->hnode, &nf_ct_helper_hash[h]);