netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Yasuyuki KOZAKAI <yasuyuki.kozakai@toshiba.co.jp>
Cc: netfilter-devel@lists.netfilter.org, davem@davemloft.net,
	Pablo Neira Ayuso <pablo@netfilter.org>
Subject: Re: [NETFILTER 01/03]: nf_conntrack: fix helper module unload races
Date: Mon, 18 Jun 2007 14:29:27 +0200	[thread overview]
Message-ID: <46767AA7.4040208@trash.net> (raw)
In-Reply-To: <200706091041.l59AfVck028409@toshiba.co.jp>

Yasuyuki KOZAKAI wrote:
> nfct_help(ct) also needs to be protected because of the race between
> nfctnetlink and helper. Sorry, I did not test the following patch because
> I don't have SMP machine.
> 
> You might dislike this.  Other idea is to use call_rcu() in
> nfctnetlink_change_helper(), but I need to study the way to use it more.
> 
> 
> [NETFILTER]: nf_conntrack: Fixes race on changing helper
> 
> nfctnetlink may change the helper assigned to a conntrack and clear
> private area in the conntrack. To fix the race, this exports spin locks
> of helpers and nfctnetlink uses them. Some helpers do not need to grab
> spin lock, because they do not store any state in the private area.
> 
> Other staff does not need to grab spin lock.
> - unhelp() assigns NULL to conntrack, but it does not touch the private
>   area.
> - init_conntrack(), nf_conntrack_alter_reply(), and
>   nfctnetlink_create_conntrack() assign a helper to a conntrack,
>   but the conntrack is unconfirmed. No competitor exists.


The fix looks correct, but considering the other problems that changing
helpers cause for ct_extend I'm wondering whether we could restrict the
helper change operation to conntracks that don't already have a helper
assigned. I can't imagine any use for changing helpers of a connection
that already has one assigned and it will always be racy anyway.
Pablo, are you aware of anything using/needing this feature?

  parent reply	other threads:[~2007-06-18 12:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-05 13:35 [NETFILTER 00/03]: Netfilter fixes Patrick McHardy
2007-06-05 13:35 ` [NETFILTER 01/03]: nf_conntrack: fix helper module unload races Patrick McHardy
2007-06-05 19:55   ` David Miller
2007-06-09 10:41   ` Yasuyuki KOZAKAI
     [not found]   ` <200706091041.l59AfVck028409@toshiba.co.jp>
2007-06-18 12:29     ` Patrick McHardy [this message]
2007-06-20 10:57       ` [NETFILTER]: nfctnetlink: Don't allow to change helper (Was: Re: [NETFILTER 01/03]: nf_conntrack: fix helper module unload races) Yasuyuki KOZAKAI
2007-06-05 13:35 ` [NETFILTER 02/03]: ip_tables: fix compat related crash Patrick McHardy
2007-06-05 19:56   ` David Miller
2007-06-05 13:35 ` [NETFILTER 03/03]: nf_conntrack_amanda: fix textsearch_prepare() error check Patrick McHardy
2007-06-05 19:57   ` David Miller

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=46767AA7.4040208@trash.net \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=pablo@netfilter.org \
    --cc=yasuyuki.kozakai@toshiba.co.jp \
    /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).