[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.GSO.4.63.1209081949500.2030@stinky-local.trash.net>
Date: Sat, 8 Sep 2012 19:50:27 +0200 (MEST)
From: Patrick McHardy <kaber@...sh.net>
To: Eric Dumazet <eric.dumazet@...il.com>
cc: Cong Wang <xiyou.wangcong@...il.com>,
Pablo Neira Ayuso <pablo@...filter.org>,
netfilter-devel@...r.kernel.org,
Linux Kernel Network Developers <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next] netfilter: x_tables: xt_init() should run
earlier
On Wed, 5 Sep 2012, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@...gle.com>
>
> Cong Wang reported a NULL dereference in xt_register_target()
>
> It turns out xt_nat_init() was called before xt_init(), so xt array
> was not yet setup.
>
> xt_init() should be marked core_initcall() to solve this problem.
>
> Reported-by: Cong Wang <xiyou.wangcong@...il.com>
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> ---
> net/netfilter/x_tables.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
> index 8d987c3..afcea11 100644
> --- a/net/netfilter/x_tables.c
> +++ b/net/netfilter/x_tables.c
> @@ -1390,6 +1390,6 @@ static void __exit xt_fini(void)
> kfree(xt);
> }
>
> -module_init(xt_init);
> +core_initcall(xt_init);
> module_exit(xt_fini);
Shouldn't we simply change the Makefile order?
View attachment "nat-oops.diff" of type "TEXT/PLAIN" (1448 bytes)
Powered by blists - more mailing lists