Received: by 2002:a17:90a:b81:0:0:0:0 with SMTP id 1csp1015882pjr; Fri, 30 Aug 2019 11:15:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqwARe+pYHOzXY+BsX/gCmCgqQSBQyePkEWp+lfhwbpm/ODBV006xcqOwoLVeRVV/d6qznUy X-Received: by 2002:a63:124a:: with SMTP id 10mr13927952pgs.254.1567188940470; Fri, 30 Aug 2019 11:15:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567188940; cv=none; d=google.com; s=arc-20160816; b=dHWHFMiGrsaZQNxKI9LeKFeZDsFJjzCh4lVnhpNoEI4t+5KrhNL033euIkc7hm8Ehi xuBaEmyY/kmBrMFCKNtMm+PrjSgDA+kDRGk9S+nJfEjt9mY2Zltfs5Cv8oMu7pUNCTqd tF7sxyFt859LiK+3S2wfPpgBU/dFbZ7OK+YaRRaQijxuN8cBCXDLUroso4cRQMPGyGYl gnjE1mSnTKoEmpu1qSH7OW4hLOFeGCvzzqI+mPOsxK3QV5A1xrtZDM3Zyb19W8RqQ49s H0B9D7XhFmQJnDDPaoermeRZs6kkMQE3xwsy/yn8h2bhlc/4F/pwwEEr0DZCo0BBhRjh jDuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=zKSw+2xbLksJ7vf35xDy7Rv4+H2U2WYOAaZNA0q8BGg=; b=i1hNnQ18QQ348uaWpHMM+/GCKViFziI+ASGMDnKKIZC32z4MuIBVohDIqiIcWOWdki Y0P7YzYYC7uwYcswrux3cF4SOcE0mdlu/XjdTOISY6TM5HydLZL/8I3mlk5GwTKW4u4/ +LklVyoaHw7RpfIsRUtCt2lgKfxX+0pkoJFVwHR8DtKryq9bXLW/29kq3u3EYs3tA9ue UskvhWQxxvIgBzPhLIc7pBO88vWORY/Usj/7vS2pgm5167mxXdwhF7zz1X0+6a9fpGf/ CVhDFQTRlYm+A3zq2kBIM8wxr24gpNT177Mg8vMAqkXV34zx1Y2p1UHM7J2TnYA+qsxf bmMA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w13si6311567pfi.181.2019.08.30.11.15.25; Fri, 30 Aug 2019 11:15:40 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727959AbfH3SOd (ORCPT + 99 others); Fri, 30 Aug 2019 14:14:33 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:2546 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727979AbfH3SOb (ORCPT ); Fri, 30 Aug 2019 14:14:31 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7UI2jbo014081; Fri, 30 Aug 2019 14:14:24 -0400 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com with ESMTP id 2uq833hhe6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Aug 2019 14:14:24 -0400 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x7UI4pZ7012110; Fri, 30 Aug 2019 18:14:23 GMT Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by ppma04dal.us.ibm.com with ESMTP id 2ujvv7dh0r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Aug 2019 18:14:23 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x7UIEMXG39911888 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2019 18:14:22 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A9557AC059; Fri, 30 Aug 2019 18:14:22 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 16ABFAC05B; Fri, 30 Aug 2019 18:14:20 +0000 (GMT) Received: from LeoBras.ibmuc.com (unknown [9.85.151.141]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 30 Aug 2019 18:14:19 +0000 (GMT) From: Leonardo Bras To: netfilter-devel@vger.kernel.org, coreteam@netfilter.org, bridge@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leonardo Bras , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , Roopa Prabhu , Nikolay Aleksandrov , "David S. Miller" Subject: [PATCH v4 2/2] net: br_netfiler_hooks: Drops IPv6 packets if IPv6 module is not loaded Date: Fri, 30 Aug 2019 15:13:54 -0300 Message-Id: <20190830181354.26279-3-leonardo@linux.ibm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190830181354.26279-1-leonardo@linux.ibm.com> References: <20190830181354.26279-1-leonardo@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-08-30_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908300176 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A kernel panic can happen if a host has disabled IPv6 on boot and have to process guest packets (coming from a bridge) using it's ip6tables. IPv6 packets need to be dropped if the IPv6 module is not loaded. Signed-off-by: Leonardo Bras --- net/bridge/br_netfilter_hooks.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/bridge/br_netfilter_hooks.c b/net/bridge/br_netfilter_hooks.c index d3f9592f4ff8..5e8693730df1 100644 --- a/net/bridge/br_netfilter_hooks.c +++ b/net/bridge/br_netfilter_hooks.c @@ -493,6 +493,8 @@ static unsigned int br_nf_pre_routing(void *priv, brnet = net_generic(state->net, brnf_net_id); if (IS_IPV6(skb) || is_vlan_ipv6(skb, state->net) || is_pppoe_ipv6(skb, state->net)) { + if (!ipv6_mod_enabled()) + return NF_DROP; if (!brnet->call_ip6tables && !br_opt_get(br, BROPT_NF_CALL_IP6TABLES)) return NF_ACCEPT; -- 2.20.1