Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2042406imm; Mon, 16 Jul 2018 00:44:44 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf74RkPmKVFKYnoSCp8ZYJflO1JToNLg13sqnXVNZJuRoT1m1DgBhnpQ0r/7R1gyiOMUtOP X-Received: by 2002:a63:1513:: with SMTP id v19-v6mr14933574pgl.358.1531727084836; Mon, 16 Jul 2018 00:44:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531727084; cv=none; d=google.com; s=arc-20160816; b=AU9BNLYCkqEs12WaGfppOYBSbIBYReSc92e7UGBmSa6v1Qz5BiQY6C22aRRY+WLwHr 79ARIsqH/yZYstnV+qbq5kgTvyReKKatJKq2A0zp9dR0iyKC/dpgjo51vPtgu1YOgoD3 ozqcSok4qQzrQOUk4qfUnjEq0NvC4P2qXBtz6GKzwkHayNWsd6UDB3Ixpp/7PHYzMfj4 aLaFo4v93+n8ctYsjD7l3KWRMGBq1fiu0q8cMCEx8L6t/avsM6HdgZD1JUFz9e1tnR9a iyYztItc8T1Blqlvse6wdLyInPA6pyqer89MuNNsC3Lfl0d7JjLd+u43pXvoXqw9JcGE ECYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=OBPsoHsKzuE7zAWqwdVHqhtv3ylc0ENwDzIqhngOaNE=; b=LRr+omMKPFc7wRPUtIqmcOATwc5EaBRqDNkaQM/EnvJPquoD4HnBAxGp4QIcbxHD1d z9gfwCY/vGE4mBQeAgzntIkOPSXUokrYjJgyLZYcA+6fFcKw1hBB6mLdMUQRwajr/2Eg eGUfSsbiuSgdDle2D0WIokwENGfzpj+oB6+gcTyUynMUiTh2rucSW/wH2LPcnwJVo4K9 GUHPDOx4ThnSV2HQruNTr5A9et/mCNlm9Tuqupgg0kTYSBCKjDbCwks5G2jTRWxfE2Je OV9XoNlUjVZ91BfAQXRyfT2WXSmBWE0siafspcQUHM2BE/UFnckxLLUQeHgc973QqOt2 PWuA== 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 r6-v6si27361882pgp.426.2018.07.16.00.44.29; Mon, 16 Jul 2018 00:44:44 -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 S2388992AbeGPIJU (ORCPT + 99 others); Mon, 16 Jul 2018 04:09:20 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47974 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730161AbeGPIJU (ORCPT ); Mon, 16 Jul 2018 04:09:20 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E93EACA0; Mon, 16 Jul 2018 07:43:16 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+da4494182233c23a5fcf@syzkaller.appspotmail.com, Florian Westphal , Pablo Neira Ayuso Subject: [PATCH 4.9 28/32] netfilter: x_tables: initialise match/target check parameter struct Date: Mon, 16 Jul 2018 09:36:36 +0200 Message-Id: <20180716073507.976113962@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073504.433996952@linuxfoundation.org> References: <20180716073504.433996952@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Florian Westphal commit c568503ef02030f169c9e19204def610a3510918 upstream. syzbot reports following splat: BUG: KMSAN: uninit-value in ebt_stp_mt_check+0x24b/0x450 net/bridge/netfilter/ebt_stp.c:162 ebt_stp_mt_check+0x24b/0x450 net/bridge/netfilter/ebt_stp.c:162 xt_check_match+0x1438/0x1650 net/netfilter/x_tables.c:506 ebt_check_match net/bridge/netfilter/ebtables.c:372 [inline] ebt_check_entry net/bridge/netfilter/ebtables.c:702 [inline] The uninitialised access is xt_mtchk_param->nft_compat ... which should be set to 0. Fix it by zeroing the struct beforehand, same for tgchk. ip(6)tables targetinfo uses c99-style initialiser, so no change needed there. Reported-by: syzbot+da4494182233c23a5fcf@syzkaller.appspotmail.com Fixes: 55917a21d0cc0 ("netfilter: x_tables: add context to know if extension runs from nft_compat") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/bridge/netfilter/ebtables.c | 2 ++ net/ipv4/netfilter/ip_tables.c | 1 + net/ipv6/netfilter/ip6_tables.c | 1 + 3 files changed, 4 insertions(+) --- a/net/bridge/netfilter/ebtables.c +++ b/net/bridge/netfilter/ebtables.c @@ -704,6 +704,8 @@ ebt_check_entry(struct ebt_entry *e, str } i = 0; + memset(&mtpar, 0, sizeof(mtpar)); + memset(&tgpar, 0, sizeof(tgpar)); mtpar.net = tgpar.net = net; mtpar.table = tgpar.table = name; mtpar.entryinfo = tgpar.entryinfo = e; --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c @@ -554,6 +554,7 @@ find_check_entry(struct ipt_entry *e, st return -ENOMEM; j = 0; + memset(&mtpar, 0, sizeof(mtpar)); mtpar.net = net; mtpar.table = name; mtpar.entryinfo = &e->ip; --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c @@ -584,6 +584,7 @@ find_check_entry(struct ip6t_entry *e, s return -ENOMEM; j = 0; + memset(&mtpar, 0, sizeof(mtpar)); mtpar.net = net; mtpar.table = name; mtpar.entryinfo = &e->ipv6;