Skip to content

Commit

Permalink
netfilter: limit the length of the helper name
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Holger Eitzenberger authored and Patrick McHardy committed Mar 25, 2009
1 parent e487eb9 commit af9d32a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/net/netfilter/nf_conntrack_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

struct module;

#define NF_CT_HELPER_NAME_LEN 16

struct nf_conntrack_helper
{
struct hlist_node hnode; /* Internal use. */
Expand Down
1 change: 1 addition & 0 deletions net/netfilter/nf_conntrack_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit af9d32a

Please sign in to comment.