All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Liping Zhang <zlpnobody@163.com>
Cc: pablo@netfilter.org, netfilter-devel@vger.kernel.org,
	Liping Zhang <zlpnobody@gmail.com>
Subject: Re: [PATCH nf-next 2/3] netfilter: nf_ct_helper: use nf_ct_iterate_cleanup to unlink helper objs
Date: Sun, 21 May 2017 10:15:21 +0200	[thread overview]
Message-ID: <20170521081521.GD1004@breakpoint.cc> (raw)
In-Reply-To: <1495345149-57674-3-git-send-email-zlpnobody@163.com>

Liping Zhang <zlpnobody@163.com> wrote:
> From: Liping Zhang <zlpnobody@gmail.com>
> 
> When we unlink the helper objects, we will iterate the nf_conntrack_hash,
> iterate the unconfirmed list, handle the hash resize situation, etc.
> 
> Actually this logic is same as the nf_ct_iterate_cleanup, so we can use it
> to remove these copy & paste codes.

Agree, this is a good idea.  However:

> --- a/net/netfilter/nf_conntrack_helper.c
> +++ b/net/netfilter/nf_conntrack_helper.c
> @@ -274,16 +274,16 @@ int __nf_ct_try_assign_helper(struct nf_conn *ct, struct nf_conn *tmpl,
>  EXPORT_SYMBOL_GPL(__nf_ct_try_assign_helper);
>  
>  /* appropriate ct lock protecting must be taken by caller */
> -static inline int unhelp(struct nf_conntrack_tuple_hash *i,
> -			 const struct nf_conntrack_helper *me)
> +static int unhelp(struct nf_conn *ct, void *me)
>  {
> -	struct nf_conn *ct = nf_ct_tuplehash_to_ctrack(i);
>  	struct nf_conn_help *help = nfct_help(ct);
>  
>  	if (help && rcu_dereference_raw(help->helper) == me) {
>  		nf_conntrack_event(IPCT_HELPER, ct);
>  		RCU_INIT_POINTER(help->helper, NULL);
>  	}

this is broken for unconfirmed conntracks, as
other cpu can reallocate the extension area.

For the module removal case, we have no choice but to toss the
unconfirmed conntracks.

Same for patch #3.

I plan to submit my patches soon, perhaps its best if I only
submit the first couple of patches so you can rebase on top of that?

Alternatively, I'm fine if your patches go in first, I can also
just rebase on top.


  reply	other threads:[~2017-05-21  8:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-21  5:39 [PATCH nf-next 0/3] netfilter: handle hash resize situation in nf_ct_iterate_cleanup Liping Zhang
2017-05-21  5:39 ` [PATCH nf-next 1/3] netfilter: restart nf ct cleanup if hash resize happen Liping Zhang
2017-05-21  8:09   ` Florian Westphal
2017-05-21  5:39 ` [PATCH nf-next 2/3] netfilter: nf_ct_helper: use nf_ct_iterate_cleanup to unlink helper objs Liping Zhang
2017-05-21  8:15   ` Florian Westphal [this message]
2017-05-21 10:17     ` Liping Zhang
2017-05-21 10:31       ` Florian Westphal
2017-05-21 11:05         ` Liping Zhang
2017-05-21 11:10           ` Florian Westphal
2017-05-21  5:39 ` [PATCH nf-next 3/3] netfilter: cttimeout: use nf_ct_iterate_cleanup to unlink timeout objs Liping Zhang
2017-05-21  8:07 ` [PATCH nf-next 0/3] netfilter: handle hash resize situation in nf_ct_iterate_cleanup Florian Westphal

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=20170521081521.GD1004@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=zlpnobody@163.com \
    --cc=zlpnobody@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.