From patchwork Wed Sep 5 16:37:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 181900 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C72062C008B for ; Thu, 6 Sep 2012 02:38:06 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753297Ab2IEQiD (ORCPT ); Wed, 5 Sep 2012 12:38:03 -0400 Received: from mail-bk0-f46.google.com ([209.85.214.46]:50496 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751999Ab2IEQiB (ORCPT ); Wed, 5 Sep 2012 12:38:01 -0400 Received: by bkwj10 with SMTP id j10so365858bkw.19 for ; Wed, 05 Sep 2012 09:38:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; bh=excamj8dawsSNV02s41NIL9OGYLGwvd1lPKCIYgg3Js=; b=0XzeJbigubvyN2sX7S99Fxw74mkT3MET54Jf+ZWO9gzfsLNSyOL0P8Rwz2Plfgpkm1 xn0Dnq1JwrS9yBnVr3k6JisHuCkVreTMUGseiBnS4jly9azN8q/eWVvC3IlxNSyYGLyE qxih5us9JpuknHAYQ16Kr5jf0nTgyof2Le1EeY+se5Ri7pkImBVp19h+V4lTkCLcWvN5 sWFrGf05BWBkRRVCyhpueXB90ndI2NNfTrWHc/N4oRntL/oqvodJuLBt9Tgp82+GKP7I kiJFBPA5+sU/LARauNEj2CappbL2bfosm5El+RDaASB9wqOB/uSDyhVZ0tht/t7EsZRP 1ebw== Received: by 10.205.117.141 with SMTP id fm13mr9962437bkc.125.1346863080368; Wed, 05 Sep 2012 09:38:00 -0700 (PDT) Received: from [192.168.162.31] ([74.125.121.33]) by mx.google.com with ESMTPS id 25sm1662268bkx.9.2012.09.05.09.37.55 (version=SSLv3 cipher=OTHER); Wed, 05 Sep 2012 09:37:58 -0700 (PDT) Subject: [PATCH net-next] netfilter: x_tables: xt_init() should run earlier From: Eric Dumazet To: Cong Wang , Pablo Neira Ayuso , Patrick McHardy Cc: netfilter-devel@vger.kernel.org, Linux Kernel Network Developers In-Reply-To: <1346861569.13121.149.camel@edumazet-glaptop> References: <1346860506.13121.148.camel@edumazet-glaptop> <1346861569.13121.149.camel@edumazet-glaptop> Date: Wed, 05 Sep 2012 18:37:53 +0200 Message-ID: <1346863073.13121.155.camel@edumazet-glaptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org 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);