]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
netfilter: nf_log: don't call synchronize_rcu in nf_log_unset
authorFlorian Westphal <fw@strlen.de>
Tue, 25 Apr 2017 08:24:03 +0000 (10:24 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 1 May 2017 09:19:07 +0000 (11:19 +0200)
nf_log_unregister() (which is what gets called in the logger backends
module exit paths) does a (required, module is removed) synchronize_rcu().

But nf_log_unset() is only called from pernet exit handlers. It doesn't
free any memory so there appears to be no need to call synchronize_rcu.

v2: Liping Zhang points out that nf_log_unregister() needs to be called
after pernet unregister, else rmmod would become unsafe.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_log.c
net/netfilter/nfnetlink_log.c

index cc32727e3f32501ffd69e278f5dd1f097993451b..8bb152a7cca499d8e9b349dcd9fe0693d6599fbf 100644 (file)
@@ -71,7 +71,6 @@ void nf_log_unset(struct net *net, const struct nf_logger *logger)
                        RCU_INIT_POINTER(net->nf.nf_loggers[i], NULL);
        }
        mutex_unlock(&nf_log_mutex);
-       synchronize_rcu();
 }
 EXPORT_SYMBOL(nf_log_unset);
 
index 896741206a50229870c23cde40c2103fa16dd35b..da9704971a83cd2f1f2808bd99061c880d9349f7 100644 (file)
@@ -1140,10 +1140,10 @@ out:
 
 static void __exit nfnetlink_log_fini(void)
 {
-       nf_log_unregister(&nfulnl_logger);
        nfnetlink_subsys_unregister(&nfulnl_subsys);
        netlink_unregister_notifier(&nfulnl_rtnl_notifier);
        unregister_pernet_subsys(&nfnl_log_net_ops);
+       nf_log_unregister(&nfulnl_logger);
 }
 
 MODULE_DESCRIPTION("netfilter userspace logging");