netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Joe Stringer <joe@ovn.org>
Cc: netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, fw@strlen.de
Subject: Re: [PATCH net] netfilter: nf_conntrack: Use net_mutex for helper unregistration.
Date: Fri, 6 May 2016 13:03:25 +0200	[thread overview]
Message-ID: <20160506110325.GA2420@salvia> (raw)
In-Reply-To: <1462488637-46877-1-git-send-email-joe@ovn.org>

Hi Joe,

On Thu, May 05, 2016 at 03:50:37PM -0700, Joe Stringer wrote:
> diff --git a/net/netfilter/nf_conntrack_helper.c b/net/netfilter/nf_conntrack_helper.c
> index 3b40ec575cd5..6860b19be406 100644
> --- a/net/netfilter/nf_conntrack_helper.c
> +++ b/net/netfilter/nf_conntrack_helper.c
> @@ -449,10 +449,10 @@ void nf_conntrack_helper_unregister(struct nf_conntrack_helper *me)
>  	 */
>  	synchronize_rcu();
>  
> -	rtnl_lock();
> +	mutex_lock(&net_mutex);
>  	for_each_net(net)
>  		__nf_conntrack_helper_unregister(me, net);
> -	rtnl_unlock();
> +	mutex_unlock(&net_mutex);

This simple solution works because we have no .exit callbacks in any
of our helpers. Otherwise, the helper code may be already gone by when
the worker has a chance to run to release the netns.

If so, probably I can append this as comment to this function so we
don't forget. If we ever have .exit callbacks (I don't expect so), we
would need to wait for worker completion.

  reply	other threads:[~2016-05-06 11:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-05 22:50 [PATCH net] netfilter: nf_conntrack: Use net_mutex for helper unregistration Joe Stringer
2016-05-06 11:03 ` Pablo Neira Ayuso [this message]
2016-05-06 19:38   ` Joe Stringer
2016-05-07  9:18     ` Florian Westphal
2016-05-17  4:38   ` Joe Stringer
2016-05-17 10:16     ` Pablo Neira Ayuso

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=20160506110325.GA2420@salvia \
    --to=pablo@netfilter.org \
    --cc=fw@strlen.de \
    --cc=joe@ovn.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).