public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Xin Long <lucien.xin@gmail.com>
Cc: network dev <netdev@vger.kernel.org>,
	netfilter-devel@vger.kernel.org, davem@davemloft.net,
	pablo@netfilter.org, fw@strlen.de
Subject: Re: [PATCH net] netfilter: unlock xt_table earlier in __do_replace
Date: Fri, 16 Feb 2018 12:02:45 +0100	[thread overview]
Message-ID: <20180216110245.GB31046@breakpoint.cc> (raw)
In-Reply-To: <61f106376f836829d8c283fb4c0cf11567c953bf.1518775496.git.lucien.xin@gmail.com>

Xin Long <lucien.xin@gmail.com> wrote:
> Now it's doing cleanup_entry for oldinfo under the xt_table lock,
> but it's not really necessary. After the replacement job is done
> in xt_replace_table, oldinfo is not used elsewhere any more, and
> it can be freed without xt_table lock safely.

Right.

> The important thing is that rtnl_lock is called in some xt_target
> destroy, which means rtnl_lock, a big lock is used in xt_table
> lock, a smaller one. It usually could be the reason why a dead
> lock may happen.

In which cases do we aquire the xt table mutex from places that hold
rtnl mutex?

> Besides, all xt_target/match checkentry is called out of xt_table
> lock. It's better also to move all cleanup_entry calling out of
> xt_table lock, just as do_replace_finish does for ebtables.

Agree but I don't see how this patch fixes a bug so I would prefer if
this could simmer in nf-next first.

  reply	other threads:[~2018-02-16 11:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-16 10:04 [PATCH net] netfilter: unlock xt_table earlier in __do_replace Xin Long
2018-02-16 11:02 ` Florian Westphal [this message]
2018-02-16 11:25   ` Xin Long
2018-03-05 22:10     ` 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=20180216110245.GB31046@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=davem@davemloft.net \
    --cc=lucien.xin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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