Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Holger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>

authored by

Holger Eitzenberger and committed by
Patrick McHardy
af9d32ad e487eb99

+3
+2
include/net/netfilter/nf_conntrack_helper.h
··· 14 14 15 15 struct module; 16 16 17 + #define NF_CT_HELPER_NAME_LEN 16 18 + 17 19 struct nf_conntrack_helper 18 20 { 19 21 struct hlist_node hnode; /* Internal use. */
+1
net/netfilter/nf_conntrack_helper.c
··· 142 142 143 143 BUG_ON(me->expect_policy == NULL); 144 144 BUG_ON(me->expect_class_max >= NF_CT_MAX_EXPECT_CLASSES); 145 + BUG_ON(strlen(me->name) > NF_CT_HELPER_NAME_LEN - 1); 145 146 146 147 mutex_lock(&nf_ct_helper_mutex); 147 148 hlist_add_head_rcu(&me->hnode, &nf_ct_helper_hash[h]);