netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netfilter: nf_log_syslog: Unset bridge logger in pernet exit
@ 2021-04-21 10:34 Phil Sutter
  2021-04-21 13:43 ` Florian Westphal
  2021-04-26  1:25 ` Pablo Neira Ayuso
  0 siblings, 2 replies; 3+ messages in thread
From: Phil Sutter @ 2021-04-21 10:34 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netfilter-devel, Florian Westphal

Without this, a stale pointer remains in pernet loggers after module
unload causing a kernel oops during dereference. Easily reproduced by:

| # modprobe nf_log_syslog
| # rmmod nf_log_syslog
| # cat /proc/net/netfilter/nf_log

Fixes: 77ccee96a6742 ("netfilter: nf_log_bridge: merge with nf_log_syslog")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 net/netfilter/nf_log_syslog.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/netfilter/nf_log_syslog.c b/net/netfilter/nf_log_syslog.c
index 025ab9c66d13e..5391eec0a44c5 100644
--- a/net/netfilter/nf_log_syslog.c
+++ b/net/netfilter/nf_log_syslog.c
@@ -1011,6 +1011,7 @@ static void __net_exit nf_log_syslog_net_exit(struct net *net)
 	nf_log_unset(net, &nf_arp_logger);
 	nf_log_unset(net, &nf_ip6_logger);
 	nf_log_unset(net, &nf_netdev_logger);
+	nf_log_unset(net, &nf_bridge_logger);
 }
 
 static struct pernet_operations nf_log_syslog_net_ops = {
-- 
2.31.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] netfilter: nf_log_syslog: Unset bridge logger in pernet exit
  2021-04-21 10:34 [PATCH] netfilter: nf_log_syslog: Unset bridge logger in pernet exit Phil Sutter
@ 2021-04-21 13:43 ` Florian Westphal
  2021-04-26  1:25 ` Pablo Neira Ayuso
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Westphal @ 2021-04-21 13:43 UTC (permalink / raw)
  To: Phil Sutter; +Cc: Pablo Neira Ayuso, netfilter-devel, Florian Westphal

Phil Sutter <phil@nwl.cc> wrote:
> Without this, a stale pointer remains in pernet loggers after module
> unload causing a kernel oops during dereference. Easily reproduced by:
> 
> | # modprobe nf_log_syslog
> | # rmmod nf_log_syslog
> | # cat /proc/net/netfilter/nf_log

Ouch, thanks for fixing this.

Acked-by: Florian Westphal <fw@strlen.de>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] netfilter: nf_log_syslog: Unset bridge logger in pernet exit
  2021-04-21 10:34 [PATCH] netfilter: nf_log_syslog: Unset bridge logger in pernet exit Phil Sutter
  2021-04-21 13:43 ` Florian Westphal
@ 2021-04-26  1:25 ` Pablo Neira Ayuso
  1 sibling, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2021-04-26  1:25 UTC (permalink / raw)
  To: Phil Sutter; +Cc: netfilter-devel, Florian Westphal

On Wed, Apr 21, 2021 at 12:34:21PM +0200, Phil Sutter wrote:
> Without this, a stale pointer remains in pernet loggers after module
> unload causing a kernel oops during dereference. Easily reproduced by:
> 
> | # modprobe nf_log_syslog
> | # rmmod nf_log_syslog
> | # cat /proc/net/netfilter/nf_log

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-26  1:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-21 10:34 [PATCH] netfilter: nf_log_syslog: Unset bridge logger in pernet exit Phil Sutter
2021-04-21 13:43 ` Florian Westphal
2021-04-26  1:25 ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).