Skip to contentSkip to conversation

netfilter: iptable_raw: drop bogus net_init annotation

PATCH Applied Florian Westphal 2 participants 2 messages Sep 17, 2021 – Sep 21, 2021

Subsystems (2)
lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH 1/1 netfilter: iptable_raw: drop bogus net_init annotation

This is a leftover from the times when this function was wired up via pernet_operations. Now its called when userspace asks for the table.

With CONFIG_NET_NS=n, iptable_raw_table_init memory has been discarded already and we get a kernel crash.

Other tables are fine, __net_init annotation was removed already.

Fixes fdacd57c79b7 ("netfilter: x_tables: never register tables by default")
---
 net/ipv4/netfilter/iptable_raw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/netfilter/iptable_raw.c +1 -1
index b88e0f36cd05..8265c6765705 100644
@@ -42,7 +42,7 @@ iptable_raw_hook(void *priv, struct sk_buff *skb,
 
 static struct nf_hook_ops *rawtable_ops __read_mostly;
 
-static int __net_init iptable_raw_table_init(struct net *net)
+static int iptable_raw_table_init(struct net *net)
 {
 	struct ipt_replace *repl;
 	const struct xt_table *table = &packet_raw;
Signature · 1 line
2.32.0
maintainer Applied
#1 lore raw
Quoted 7 lines · Florian Westphal

This is a leftover from the times when this function was wired up via pernet_operations. Now its called when userspace asks for the table.

With CONFIG_NET_NS=n, iptable_raw_table_init memory has been discarded already and we get a kernel crash.

Other tables are fine, __net_init annotation was removed already.

Applied, thanks.