netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nf] netfilter: iptable_raw: drop bogus net_init annotation
@ 2021-09-17  9:56 Florian Westphal
  2021-09-21  1:51 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Westphal @ 2021-09-17  9:56 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Florian Westphal, youling 257

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")
Reported-by: youling 257 <youling257@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
---
 net/ipv4/netfilter/iptable_raw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/netfilter/iptable_raw.c b/net/ipv4/netfilter/iptable_raw.c
index b88e0f36cd05..8265c6765705 100644
--- a/net/ipv4/netfilter/iptable_raw.c
+++ b/net/ipv4/netfilter/iptable_raw.c
@@ -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;
-- 
2.32.0


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

* Re: [PATCH nf] netfilter: iptable_raw: drop bogus net_init annotation
  2021-09-17  9:56 [PATCH nf] netfilter: iptable_raw: drop bogus net_init annotation Florian Westphal
@ 2021-09-21  1:51 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2021-09-21  1:51 UTC (permalink / raw)
  To: Florian Westphal; +Cc: netfilter-devel, youling 257

On Fri, Sep 17, 2021 at 11:56:25AM +0200, Florian Westphal wrote:
> 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.

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

end of thread, other threads:[~2021-09-21  1:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-17  9:56 [PATCH nf] netfilter: iptable_raw: drop bogus net_init annotation Florian Westphal
2021-09-21  1:51 ` 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).