]> git.hungrycats.org Git - linux/commitdiff
netfilter: ctnetlink: fix scheduling while atomic
authorPatrick McHardy <kaber@trash.net>
Wed, 21 Jan 2009 20:19:49 +0000 (12:19 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 6 Feb 2009 21:47:18 +0000 (13:47 -0800)
commit 748085fcbedbf7b0f38d95e178265d7b13360b44 upstream.

Caused by call to request_module() while holding nf_conntrack_lock.

Reported-and-tested-by: Kövesdi György <kgy@teledigit.hu>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/netfilter/nf_conntrack_netlink.c

index 5f4a6516b3b6b6f935e677f774c22de1c038dccb..8e9a3036c37ff1047e213c5e571620a82e2b6299 100644 (file)
@@ -825,13 +825,16 @@ 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;