Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2043998imm; Mon, 16 Jul 2018 00:47:08 -0700 (PDT) X-Google-Smtp-Source: AAOMgpelrBl3hwS60tj8B/XNKRgUMO3nwe9M6H6L1zjdCbevumiqP+gC4Sum1FXDrSnsJwRTGPWi X-Received: by 2002:a63:5a5e:: with SMTP id k30-v6mr14890079pgm.123.1531727228170; Mon, 16 Jul 2018 00:47:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531727228; cv=none; d=google.com; s=arc-20160816; b=w+7oa0pC2Sek92+Zx2lxbO8zEAZARmD1IQqu+8mlEVarbwZLKQ1taZt9xn7P6bD/sY qDt/QMwO0mR48LeMyJSqxA4+pyGsqc3JnXFNwUAvxlr15qUutICJHjWqaWZ76G5Vs2uu nIne4/xPn+HVpx3SnRtC7N9WfUrl2yp7/yQu5px6Z9Ctjb3JM9K4L1OZs+HkQHu22MYu 6xKMOe3ojHGv+6vzQ2YoY8kYYPOECVEq8ff87jRWfz3ros+6NuKemyunG8Hhi1jJbwyc 27RA7GuOqo+8Gjnz7ZzV5PDpyjO8UQIg9lIqNf3A3Bf9tqsK3iaJG+35YaE9h+liComW CwEQ== 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=p3+adn/s1nTrqt8F1xgBrY9uH0yy+n4uY7IgcbchYRc=; b=uxDBzXW7oHJowio5DLWxLk/nzKNogzKXqd9VNA9O+soTVTXgnbLX4mDJewlkfntgDK EtxgiC7r3OiIJLIZlCDAoIt/CpBe13Lb8t0gPF4A4FKmzb70GfVFtuzVuUe5JSzRO5vr KBBb1p4UlbbpqqPRF8a0sNNQHFJ9G1YZXZZxB3vRd0tnqF4fJwBT2+9e1SU4OcDTD/Cd y2mGp0E9uZ0/FQu4dWyF6njIdSqFw8RBsRPPBkyqutoG0aZ2Riu9+XtaBRaifougBuFC aAFhfu+52Qw9qaijG3rczfKLy3hEMWKG3nlIU/+9fvxXHmnklLmsjLHd43US8D/Ntjrb eHsg== 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 w23-v6si28395934pgl.282.2018.07.16.00.46.53; Mon, 16 Jul 2018 00:47:08 -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 S2389594AbeGPIL2 (ORCPT + 99 others); Mon, 16 Jul 2018 04:11:28 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49478 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388873AbeGPIL2 (ORCPT ); Mon, 16 Jul 2018 04:11:28 -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 7BD19CA5; Mon, 16 Jul 2018 07:45:24 +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.4 39/43] netfilter: x_tables: initialise match/target check parameter struct Date: Mon, 16 Jul 2018 09:36:44 +0200 Message-Id: <20180716073516.206581527@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073511.796555857@linuxfoundation.org> References: <20180716073511.796555857@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.4-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 @@ -701,6 +701,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 @@ -663,6 +663,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 @@ -676,6 +676,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;