Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2039291imm; Mon, 16 Jul 2018 00:40:11 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfHc8bc+zAVNiHC5f24Fr20WQjM1v1jXMI51Eatka6O7gnMi3u8XCC1yk2chkKLMSwGEY41 X-Received: by 2002:a62:4494:: with SMTP id m20-v6mr16810162pfi.205.1531726811249; Mon, 16 Jul 2018 00:40:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531726811; cv=none; d=google.com; s=arc-20160816; b=E9e6WfqMpHwmNVS8S6aJ9s4XAFsu6iGXdvNDW0l+7rsSx1N4L/k542XtE3RhewczNe VZEhtXvkMiEOBlrFf3xpGLDa5sRz9+kB8RA8WG2GjGo9lSR7iEcwz4DjL6aacBgcKNtI qKLQsdf79ug7ft2Xv3BR7DqP582mmlPHRIGqQ0X440mpDQNS9nKsjg5925O+obEpTPw0 O0MDZNXgktA5PiquB7zmkykvt5BUzhgzXazPOQn5EQ0y80OhR3t4npf6T8iSJCORKNmL y1zwGpzBs8ivbUwabYG7Jb0QSBk/NdbqO99JKwoRwrxripZ8fJb1Zq9vOhK19N3l9D4A MCNQ== 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=2fyJYmXScM/f8PQLPoMxhSfZ0UAbo6+s0/ynT6wvKis=; b=Rdjd85dac+RRQQRglwefgS4NZbXXPwmFJzBQ5PZHJUA18d6ivGlFW96y0XH2uz5AwK f/cbGtDKuMtaAriiH9wzBEFaiFYr6Vhn+fsTYotRGh/zLSBbbPETnzj25e8uA9laJaDI kyJolJSyDskFYEVstHN7rK8J72qOjWa53N2GYonKPGArxAloou+7AR+noqY63e6xL7+E Zu1AvTqFjymWjGhAV4anzFZi6J7WFC7i7+SlO5fGuiHCgjJgXC2q2HQZ8BXmL/rYD/nd zSRJF9424NIadlmsWb67MdSBP63w2EDPPJW+vrVKxiEq82K10ZNAez2fEfJWlPGinCKL QJ2A== 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 z33-v6si29332486plb.380.2018.07.16.00.39.55; Mon, 16 Jul 2018 00:40:11 -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 S2387717AbeGPIEs (ORCPT + 99 others); Mon, 16 Jul 2018 04:04:48 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46992 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726898AbeGPIEr (ORCPT ); Mon, 16 Jul 2018 04:04:47 -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 E3D4ECA1; Mon, 16 Jul 2018 07:38:45 +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.17 56/67] netfilter: x_tables: initialise match/target check parameter struct Date: Mon, 16 Jul 2018 09:35:25 +0200 Message-Id: <20180716073452.556943376@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073443.294323458@linuxfoundation.org> References: <20180716073443.294323458@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.17-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 @@ -694,6 +694,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 @@ -531,6 +531,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 @@ -551,6 +551,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;