Skip to contentSkip to conversation

netfilter: nf_log_syslog: Unset bridge logger in pernet exit

PATCH Applied Phil Sutter 3 participants 3 messages Apr 21, 2021 – Apr 26, 2021

Subsystems (2)
lore
Share & tools
lore

Phil Sutter

author reviewer
#0 lore raw

PATCH 1/1 netfilter: nf_log_syslog: Unset bridge logger in pernet exit

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")
---
 net/netfilter/nf_log_syslog.c | 1 +
 1 file changed, 1 insertion(+)
net/netfilter/nf_log_syslog.c +1 -0
index 025ab9c66d13e..5391eec0a44c5 100644
@@ -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 = {
Signature · 1 line
2.31.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Phil Sutter

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.

maintainer Applied
#2 lore raw
In reply to Phil Sutter
Quoted 6 lines · Phil Sutter

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.