Patchwork netfilter: ctnetlink: fix module auto-load in ctnetlink_create_conntrack

login
register
mail settings
Submitter Pablo Neira
Date Sept. 11, 2012, 3:52 p.m.
Message ID <1347378735-22625-1-git-send-email-pablo@netfilter.org>
Download mbox | patch
Permalink /patch/183172/
State Changes Requested
Headers show

Comments

Pablo Neira - Sept. 11, 2012, 3:52 p.m.
From: Pablo Neira Ayuso <pablo@netfilter.org>

(c7232c9 netfilter: add protocol independent NAT core) added
incorrect locking for the module auto-load case in ctnetlink_parse_nat.

That function is always called from ctnetlink_create_conntrack which
requires no locking.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 net/netfilter/nf_conntrack_netlink.c |    2 --
 1 file changed, 2 deletions(-)

Patch

diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index a205bd6..257da50 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -1120,7 +1120,6 @@  ctnetlink_parse_nat_setup(struct nf_conn *ct,
 	if (err == -EAGAIN) {
 #ifdef CONFIG_MODULES
 		rcu_read_unlock();
-		spin_unlock_bh(&nf_conntrack_lock);
 		nfnl_unlock();
 		if (request_module("nf-nat-%u", nf_ct_l3num(ct)) < 0) {
 			nfnl_lock();
@@ -1129,7 +1128,6 @@  ctnetlink_parse_nat_setup(struct nf_conn *ct,
 			return -EOPNOTSUPP;
 		}
 		nfnl_lock();
-		spin_lock_bh(&nf_conntrack_lock);
 		rcu_read_lock();
 #else
 		err = -EOPNOTSUPP;