This is a note to let you know that I've just added the patch titled

    netfilter: nf_conntrack: fix BUG_ON while removing nf_conntrack with netns

to the 3.7-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     
netfilter-nf_conntrack-fix-bug_on-while-removing-nf_conntrack-with-netns.patch
and it can be found in the queue-3.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 1e47ee8367babe6a5e8adf44a714c7086657b87e Mon Sep 17 00:00:00 2001
From: Pablo Neira Ayuso <[email protected]>
Date: Thu, 10 Jan 2013 16:12:01 +0100
Subject: netfilter: nf_conntrack: fix BUG_ON while removing nf_conntrack with 
netns

From: Pablo Neira Ayuso <[email protected]>

commit 1e47ee8367babe6a5e8adf44a714c7086657b87e upstream.

canqun zhang reported that we're hitting BUG_ON in the
nf_conntrack_destroy path when calling kfree_skb while
rmmod'ing the nf_conntrack module.

Currently, the nf_ct_destroy hook is being set to NULL in the
destroy path of conntrack.init_net. However, this is a problem
since init_net may be destroyed before any other existing netns
(we cannot assume any specific ordering while releasing existing
netns according to what I read in recent emails).

Thanks to Gao feng for initial patch to address this issue.

Reported-by: canqun zhang <[email protected]>
Acked-by: Gao feng <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 include/net/netfilter/nf_conntrack_core.h |    2 ++
 net/netfilter/nf_conntrack_core.c         |    9 +++++----
 net/netfilter/nf_conntrack_standalone.c   |    1 +
 3 files changed, 8 insertions(+), 4 deletions(-)

--- a/include/net/netfilter/nf_conntrack_core.h
+++ b/include/net/netfilter/nf_conntrack_core.h
@@ -31,6 +31,8 @@ extern void nf_conntrack_cleanup(struct
 extern int nf_conntrack_proto_init(struct net *net);
 extern void nf_conntrack_proto_fini(struct net *net);
 
+extern void nf_conntrack_cleanup_end(void);
+
 extern bool
 nf_ct_get_tuple(const struct sk_buff *skb,
                unsigned int nhoff,
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -1383,11 +1383,12 @@ void nf_conntrack_cleanup(struct net *ne
        synchronize_net();
        nf_conntrack_proto_fini(net);
        nf_conntrack_cleanup_net(net);
+}
 
-       if (net_eq(net, &init_net)) {
-               RCU_INIT_POINTER(nf_ct_destroy, NULL);
-               nf_conntrack_cleanup_init_net();
-       }
+void nf_conntrack_cleanup_end(void)
+{
+       RCU_INIT_POINTER(nf_ct_destroy, NULL);
+       nf_conntrack_cleanup_init_net();
 }
 
 void *nf_ct_alloc_hashtable(unsigned int *sizep, int nulls)
--- a/net/netfilter/nf_conntrack_standalone.c
+++ b/net/netfilter/nf_conntrack_standalone.c
@@ -571,6 +571,7 @@ static int __init nf_conntrack_standalon
 static void __exit nf_conntrack_standalone_fini(void)
 {
        unregister_pernet_subsys(&nf_conntrack_net_ops);
+       nf_conntrack_cleanup_end();
 }
 
 module_init(nf_conntrack_standalone_init);


Patches currently in stable-queue which might be from [email protected] are

queue-3.7/netfilter-nf_conntrack-fix-bug_on-while-removing-nf_conntrack-with-netns.patch
queue-3.7/netfilter-nfnetlink_log-fix-mac-address-for-6in4-tunnels.patch
queue-3.7/netfilter-nfnetlink_log-fix-possible-compilation-issue-due-to-missing-include.patch
queue-3.7/netfilter-xt_recent-fix-namespace-destroy-path.patch
queue-3.7/netfilter-ipt_reject-fix-wrong-transport-header-pointer-in-tcp-reset.patch
queue-3.7/netfilter-xt_ct-recover-notrack-target-support.patch
queue-3.7/netfilter-ctnetlink-fix-leak-in-error-path-of-ctnetlink_create_expect.patch
queue-3.7/netfilter-xt_hashlimit-fix-race-that-results-in-duplicated-entries.patch
queue-3.7/netfilter-x_tables-print-correct-hook-names-for-arp.patch
queue-3.7/netfilter-fix-missing-dependencies-for-the-notrack-target.patch
queue-3.7/netfilter-nf_ct_reasm-fix-conntrack-reassembly-expire-code.patch
queue-3.7/netfilter-xt_recent-avoid-high-order-page-allocations.patch
queue-3.7/netfilter-xt_hashlimit-fix-namespace-destroy-path.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to