netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Holger Eitzenberger <holger@eitzenberger.org>
Cc: David Miller <davem@davemloft.net>,
	netfilter-devel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [patch 3/6] netfilter: limit the length of the helper name
Date: Wed, 25 Mar 2009 18:32:26 +0100	[thread overview]
Message-ID: <49CA6AAA.1050305@trash.net> (raw)
In-Reply-To: <20090316221138.326410717@jonathan.eitzenberger.org>

Holger Eitzenberger wrote:
> 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>
> 
> Index: net-next-2.6/include/net/netfilter/nf_conntrack_helper.h
> ===================================================================
> --- net-next-2.6.orig/include/net/netfilter/nf_conntrack_helper.h
> +++ net-next-2.6/include/net/netfilter/nf_conntrack_helper.h
> @@ -14,6 +14,8 @@
>  
>  struct module;
>  
> +#define NF_CT_HELPER_NAME_LEN	16
> +
>  struct nf_conntrack_helper
>  {
>  	struct hlist_node hnode;	/* Internal use. */
> Index: net-next-2.6/net/netfilter/nf_conntrack_helper.c
> ===================================================================
> --- net-next-2.6.orig/net/netfilter/nf_conntrack_helper.c
> +++ net-next-2.6/net/netfilter/nf_conntrack_helper.c
> @@ -142,6 +142,7 @@ int nf_conntrack_helper_register(struct 
>  
>  	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);

This appears to be an off-by-one. A strlen of exactly
NF_CT_HELPER_NAME_LEN - 1 would be fine, right?

No need to resend, just let me know whether I should change it.

  reply	other threads:[~2009-03-25 17:32 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-16 22:06 [patch 0/6] netfilter: ctnetlink allocation improvement Holger Eitzenberger
2009-03-16 22:07 ` [patch 1/6] ctnetlink: add callbacks to the per-proto nlattrs Holger Eitzenberger
2009-03-25 17:25   ` Patrick McHardy
2009-03-16 22:07 ` [patch 2/6] netlink: add nla_policy_len() Holger Eitzenberger
2009-03-25 17:27   ` Patrick McHardy
2009-03-16 22:07 ` [patch 3/6] netfilter: limit the length of the helper name Holger Eitzenberger
2009-03-25 17:32   ` Patrick McHardy [this message]
2009-03-25 17:41     ` Holger Eitzenberger
2009-03-25 17:44       ` Patrick McHardy
2009-03-16 22:07 ` [patch 4/6] ctnetlink: allocate right-sized ctnetlink skb Holger Eitzenberger
2009-03-25 17:46   ` Patrick McHardy
2009-03-16 22:07 ` [patch 5/6] netfilter: add generic function to get len of generic policy Holger Eitzenberger
2009-03-16 22:07 ` [patch 6/6] netfilter: calculate per-protocol nlattr size Holger Eitzenberger
2009-03-17  4:35 ` [patch 0/6] netfilter: ctnetlink allocation improvement Patrick McHardy
2009-03-17  7:39   ` Holger Eitzenberger
2009-03-17  9:07   ` Florian Westphal
2009-03-17 10:24   ` Pablo Neira Ayuso
2009-03-17  9:49 ` Pablo Neira Ayuso
2009-03-17 10:03   ` Holger Eitzenberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49CA6AAA.1050305@trash.net \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=holger@eitzenberger.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).