From patchwork Wed Sep 5 16:37:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [net-next] netfilter: x_tables: xt_init() should run earlier Date: Wed, 05 Sep 2012 06:37:53 -0000 From: Eric Dumazet X-Patchwork-Id: 181900 Message-Id: <1346863073.13121.155.camel@edumazet-glaptop> To: Cong Wang , Pablo Neira Ayuso , Patrick McHardy Cc: netfilter-devel@vger.kernel.org, Linux Kernel Network Developers From: Eric Dumazet 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 Signed-off-by: Eric Dumazet --- net/netfilter/x_tables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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);