mirror of
https://github.com/raspberrypi/linux.git
synced 2026-01-04 18:27:36 +00:00
netfilter: nf_log: don't zap all loggers on unregister
commit205ee117d4upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
146560ee78
commit
a365025b05
@@ -107,11 +107,15 @@ EXPORT_SYMBOL(nf_log_register);
|
|||||||
|
|
||||||
void nf_log_unregister(struct nf_logger *logger)
|
void nf_log_unregister(struct nf_logger *logger)
|
||||||
{
|
{
|
||||||
|
const struct nf_logger *log;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
mutex_lock(&nf_log_mutex);
|
mutex_lock(&nf_log_mutex);
|
||||||
for (i = 0; i < NFPROTO_NUMPROTO; i++)
|
for (i = 0; i < NFPROTO_NUMPROTO; i++) {
|
||||||
RCU_INIT_POINTER(loggers[i][logger->type], NULL);
|
log = nft_log_dereference(loggers[i][logger->type]);
|
||||||
|
if (log == logger)
|
||||||
|
RCU_INIT_POINTER(loggers[i][logger->type], NULL);
|
||||||
|
}
|
||||||
mutex_unlock(&nf_log_mutex);
|
mutex_unlock(&nf_log_mutex);
|
||||||
synchronize_rcu();
|
synchronize_rcu();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user