netfilter: limit the length of the helper name
authorHolger Eitzenberger <holger@eitzenberger.org>
Wed, 25 Mar 2009 17:44:01 +0000 (18:44 +0100)
committerPatrick McHardy <kaber@trash.net>
Wed, 25 Mar 2009 17:44:01 +0000 (18:44 +0100)
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: Holger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
include/net/netfilter/nf_conntrack_helper.h
net/netfilter/nf_conntrack_helper.c

index 66d65a7caa394164776c8559d3c5bd41c55bc8d8..ee2a4b369a0466ac884af3f282dec210e41c2a56 100644 (file)
@@ -14,6 +14,8 @@
 
 struct module;
 
+#define NF_CT_HELPER_NAME_LEN  16
+
 struct nf_conntrack_helper
 {
        struct hlist_node hnode;        /* Internal use. */
index a51bdac9f3a0682a442d833d44a82c813cd19eff..805cfdd42303f84be1b2f68c554ff59e737ffba1 100644 (file)
@@ -142,6 +142,7 @@ int nf_conntrack_helper_register(struct nf_conntrack_helper *me)
 
        BUG_ON(me->expect_policy == NULL);
        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);
        hlist_add_head_rcu(&me->hnode, &nf_ct_helper_hash[h]);