Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3599737ybl; Mon, 19 Aug 2019 22:37:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxCvrKW1gxf6RCrOxhLF1qmRg1pkdpL3oR5z595/CDvfBK3fOFttEJ4lwXJsYGcaKS0MmSn X-Received: by 2002:a17:902:b202:: with SMTP id t2mr26935599plr.303.1566279455557; Mon, 19 Aug 2019 22:37:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566279455; cv=none; d=google.com; s=arc-20160816; b=u4zw/iXEIWkQFIOhnm05BhzUymYQiHLDjj3OxKK9oc8uqy5iCzS/HhoTpI+IaHFOy3 RgTtJgMOMeIRGPXtEpcSk3JWtzGgec5mQcMxOC9Au1XDbOh83SqtcmtFmafjRRgCPQKj l3qYSrWPwiWVROAKQb4aNXfCG1iuhuUUOMP6XpozOAUz7kp8FcZ+vu8KY3P631bmzmiV 9YeGY4+yvfrYzmYBIL4sSAK/hHl3lsN/NSruFeGxWY6QFaUArOzjGXd3XEvJcpgBw3cT Fs59WEhqqEwMtSstmRMv6nY65ilyfJ1drftK/CED4RoN8TKYSjmsXnSOt7/f4WBh3EHy gbEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=3SqzZGzug0Phv45yUPU6Lz618d2OcStf4tgiSaj91lk=; b=cPigEl7i5hMfmoqzDYwrUIV7DjvsrUuaJZA1Tp7HOnDlpfJHGR36QsYeD9tWO8RXnL ndKCgaaW/vG+8Yz/w3X5GQvP5aXY6LG99z51eEVN1iqsdk/pwVVghpzTrUlJ4NkOOvq8 FxNMRh/kRAahqPl3Y8sBfvDCXGp9FlGVviquBMZQWbnewwB4edNzYw3ug9DY9irIbLaH T3sfmtzZMYVWeGs9eFMUiNiuiv6PlNEZ0ooPwWrgIXukObX3c0ShzqvsajDVCjiLk1hv HOOADRqkXa9K84UbXtCucWKCSjI6ZBAQuToWfbs2L928jcumhZVEQSiZQHeQmlIjKdwT U9gQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z11si10620476plo.64.2019.08.19.22.37.20; Mon, 19 Aug 2019 22:37:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729198AbfHTFgL (ORCPT + 99 others); Tue, 20 Aug 2019 01:36:11 -0400 Received: from Chamillionaire.breakpoint.cc ([193.142.43.52]:60736 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729147AbfHTFgK (ORCPT ); Tue, 20 Aug 2019 01:36:10 -0400 Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1hzwoR-00028O-3t; Tue, 20 Aug 2019 07:36:07 +0200 Date: Tue, 20 Aug 2019 07:36:07 +0200 From: Florian Westphal To: Leonardo Bras Cc: netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" Subject: Re: [PATCH 1/1] netfilter: nf_tables: fib: Drop IPV6 packages if IPv6 is disabled on boot Message-ID: <20190820053607.GL2588@breakpoint.cc> References: <20190820005821.2644-1-leonardo@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190820005821.2644-1-leonardo@linux.ibm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Leonardo Bras wrote: > If IPv6 is disabled on boot (ipv6.disable=1), but nft_fib_inet ends up > dealing with a IPv6 package, it causes a kernel panic in > fib6_node_lookup_1(), crashing in bad_page_fault. > > The panic is caused by trying to deference a very low address (0x38 > in ppc64le), due to ipv6.fib6_main_tbl = NULL. > BUG: Kernel NULL pointer dereference at 0x00000038 > > Fix this behavior by dropping IPv6 packages if !ipv6_mod_enabled(). Wouldn't fib_netdev.c have the same problem? If so, might be better to place this test in both nft_fib6_eval_type and nft_fib6_eval.