Skip to contentSkip to conversation

netfilter: ctnetlink: remove incorrect spin_[un]lock_bh on NAT module autoload

PATCH [email protected] 1 participant 1 message Mar 3, 2012

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

From: Pablo Neira Ayuso <[email protected]>

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.

---
 net/netfilter/nf_conntrack_netlink.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
net/netfilter/nf_conntrack_netlink.c +0 -3
index 30c9d4c..1068769 100644
@@ -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;
Signature · 1 line
1.7.7.3