提交 c83fa196 编写于 作者: F Florian Westphal 提交者: Pablo Neira Ayuso

netfilter: nf_log: don't call synchronize_rcu in nf_log_unset

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: NFlorian Westphal <fw@strlen.de>
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
上级 933bd83e
...@@ -71,7 +71,6 @@ void nf_log_unset(struct net *net, const struct nf_logger *logger) ...@@ -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); RCU_INIT_POINTER(net->nf.nf_loggers[i], NULL);
} }
mutex_unlock(&nf_log_mutex); mutex_unlock(&nf_log_mutex);
synchronize_rcu();
} }
EXPORT_SYMBOL(nf_log_unset); EXPORT_SYMBOL(nf_log_unset);
......
...@@ -1140,10 +1140,10 @@ static int __init nfnetlink_log_init(void) ...@@ -1140,10 +1140,10 @@ static int __init nfnetlink_log_init(void)
static void __exit nfnetlink_log_fini(void) static void __exit nfnetlink_log_fini(void)
{ {
nf_log_unregister(&nfulnl_logger);
nfnetlink_subsys_unregister(&nfulnl_subsys); nfnetlink_subsys_unregister(&nfulnl_subsys);
netlink_unregister_notifier(&nfulnl_rtnl_notifier); netlink_unregister_notifier(&nfulnl_rtnl_notifier);
unregister_pernet_subsys(&nfnl_log_net_ops); unregister_pernet_subsys(&nfnl_log_net_ops);
nf_log_unregister(&nfulnl_logger);
} }
MODULE_DESCRIPTION("netfilter userspace logging"); MODULE_DESCRIPTION("netfilter userspace logging");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册