aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/nf_log.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2015-09-09 02:57:21 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2015-09-14 14:40:24 +0200
commit205ee117d4dc4a11ac3bd9638bb9b2e839f4de9a (patch)
tree727c94e59568c404c14747f106fe8ae67d91dd22 /net/netfilter/nf_log.c
parentirda: ali-ircc: Fix deadlock in ali_ircc_sir_change_speed() (diff)
downloadlinux-dev-205ee117d4dc4a11ac3bd9638bb9b2e839f4de9a.tar.xz
linux-dev-205ee117d4dc4a11ac3bd9638bb9b2e839f4de9a.zip
netfilter: nf_log: don't zap all loggers on unregister
like nf_log_unset, nf_log_unregister must not reset the list of loggers. Otherwise, a call to nf_log_unregister() will render loggers of other nf protocols unusable: iptables -A INPUT -j LOG modprobe nf_log_arp ; rmmod nf_log_arp iptables -A INPUT -j LOG iptables: No chain/target/match by that name Fixes: 30e0c6a6be ("netfilter: nf_log: prepare net namespace support for loggers") Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nf_log.c')
-rw-r--r--net/netfilter/nf_log.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c
index 675d12c69e32..a5ebd7d9c472 100644
--- a/net/netfilter/nf_log.c
+++ b/net/netfilter/nf_log.c
@@ -107,11 +107,15 @@ EXPORT_SYMBOL(nf_log_register);
void nf_log_unregister(struct nf_logger *logger)
{
+ const struct nf_logger *log;
int i;
mutex_lock(&nf_log_mutex);
- for (i = 0; i < NFPROTO_NUMPROTO; i++)
- RCU_INIT_POINTER(loggers[i][logger->type], NULL);
+ for (i = 0; i < NFPROTO_NUMPROTO; i++) {
+ log = nft_log_dereference(loggers[i][logger->type]);
+ if (log == logger)
+ RCU_INIT_POINTER(loggers[i][logger->type], NULL);
+ }
mutex_unlock(&nf_log_mutex);
}
EXPORT_SYMBOL(nf_log_unregister);