netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: pablo@netfilter.org
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH 2/6] netfilter: ctnetlink: remove incorrect spin_[un]lock_bh on NAT module autoload
Date: Tue,  6 Mar 2012 12:22:51 +0100	[thread overview]
Message-ID: <1331032975-5303-3-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1331032975-5303-1-git-send-email-pablo@netfilter.org>

From: Pablo Neira Ayuso <pablo@netfilter.org>

Since 7d367e0, ctnetlink_new_conntrack is called without holding
the nf_conntrack_lock spinlock. Thus, ctnetlink_parse_nat_setup
does not require to release that spinlock anymore in the NAT module
autoload case.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 net/netfilter/nf_conntrack_netlink.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index 30c9d4c..1068769 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -1041,16 +1041,13 @@ ctnetlink_parse_nat_setup(struct nf_conn *ct,
 	if (!parse_nat_setup) {
 #ifdef CONFIG_MODULES
 		rcu_read_unlock();
-		spin_unlock_bh(&nf_conntrack_lock);
 		nfnl_unlock();
 		if (request_module("nf-nat-ipv4") < 0) {
 			nfnl_lock();
-			spin_lock_bh(&nf_conntrack_lock);
 			rcu_read_lock();
 			return -EOPNOTSUPP;
 		}
 		nfnl_lock();
-		spin_lock_bh(&nf_conntrack_lock);
 		rcu_read_lock();
 		if (nfnetlink_parse_nat_setup_hook)
 			return -EAGAIN;
-- 
1.7.7.3

  parent reply	other threads:[~2012-03-06 11:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-06 11:22 [PATCH 0/6] netfilter fixes for 3.3-rc6 pablo
2012-03-06 11:22 ` [PATCH 1/6] netfilter: ebtables: fix wrong name length while copying to user-space pablo
2012-03-06 20:15   ` David Miller
2012-03-06 11:22 ` pablo [this message]
2012-03-06 20:15   ` [PATCH 2/6] netfilter: ctnetlink: remove incorrect spin_[un]lock_bh on NAT module autoload David Miller
2012-03-06 11:22 ` [PATCH 3/6] netfilter: ctnetlink: use GFP_ATOMIC in all allocations pablo
2012-03-06 12:50   ` Eric Dumazet
2012-03-06 14:48     ` Pablo Neira Ayuso
2012-03-06 15:09       ` Eric Dumazet
2012-03-06 15:35         ` Pablo Neira Ayuso
2012-03-06 20:20       ` David Miller
2012-03-06 11:22 ` [PATCH 4/6] netfilter: bridge: fix wrong pointer dereference pablo
2012-03-06 20:15   ` David Miller
2012-03-06 11:22 ` [PATCH 5/6] bridge: netfilter: don't call iptables on vlan packets if sysctl is off pablo
2012-03-06 20:15   ` David Miller
2012-03-06 11:22 ` [PATCH 6/6] netfilter: nf_conntrack: fix early_drop with reliable event delivery pablo
2012-03-06 20:16   ` David Miller
2012-03-07 13:19     ` 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=1331032975-5303-3-git-send-email-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=davem@davemloft.net \
    --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).