Skip to content

Commit c83fa19

Browse files
Florian Westphalummakynes
authored andcommitted
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: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent 933bd83 commit c83fa19

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

‎net/netfilter/nf_log.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ void nf_log_unset(struct net *net, const struct nf_logger *logger)
7171
RCU_INIT_POINTER(net->nf.nf_loggers[i], NULL);
7272
}
7373
mutex_unlock(&nf_log_mutex);
74-
synchronize_rcu();
7574
}
7675
EXPORT_SYMBOL(nf_log_unset);
7776

‎net/netfilter/nfnetlink_log.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,10 +1140,10 @@ static int __init nfnetlink_log_init(void)
11401140

11411141
static void __exit nfnetlink_log_fini(void)
11421142
{
1143-
nf_log_unregister(&nfulnl_logger);
11441143
nfnetlink_subsys_unregister(&nfulnl_subsys);
11451144
netlink_unregister_notifier(&nfulnl_rtnl_notifier);
11461145
unregister_pernet_subsys(&nfnl_log_net_ops);
1146+
nf_log_unregister(&nfulnl_logger);
11471147
}
11481148

11491149
MODULE_DESCRIPTION("netfilter userspace logging");

0 commit comments

Comments
 (0)