Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3721918imu; Mon, 7 Jan 2019 08:17:36 -0800 (PST) X-Google-Smtp-Source: ALg8bN529w6KmdH/XrcR86AxBSklUXKxjkBDOKq90JbZ/gul5mwQREu6TFoMKlnO1PbONwNqxohz X-Received: by 2002:a17:902:4464:: with SMTP id k91mr62620611pld.13.1546877856644; Mon, 07 Jan 2019 08:17:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546877856; cv=none; d=google.com; s=arc-20160816; b=tWWWCKkS4tBo939JzManLR3cmEOBNYNPF42To0xzMCSCvyUyIN/jFjxCbUBvVzsYfx Xu5FerdjkQPU+ea4XlY4VdcqagApnixynCPdGwJb3e2MDi7gOMbgOK75Uq2wnLtYMlSz swSl+MxQynZjYMhRU42ssJ1JSWXIRxpuDBu7XPn3O0NLLx3QD/knTBDW0Mm1nKtSrPFN GKnPOBlVkj3mckKUu6IsZvds4CyjVv6hIaNWLyADhiDktmGeVN4oRHuDKSnXlMhVZO/P akiu4xLuBhnRK4gIMXDAeazP9Bhe+xKAel8AqBKLyvQ+Sc40xLNsWMrF9qi6vaGmS7bo OZxw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aB9NHQKTWgGf3L1Me3NuUrEI9m+pQRGPQ15Vuu75/2U=; b=YxnuCavwtkm/gecS1sDVdlmxFqmT7kJNh7rH1KKgMCmLHjkh/N+saTY/N4BUe97Zgz 41OAijx2qDkSdaOgpNFvC8/70ohprboeMMdKP7B1hqPcNfIPlFwPCtgp0MZnSn//yX/J M3Ir2bhb4cjuoE1WQWT2LBqg+iV0thjjwcOso7XzOy/HBGE/STwHAMugWA0bYfIe3EPP jZL1HIaZHhY0jBq5trcxQbQ2xVJMu2hRXm4WFAgIXo/zka1bD/Fv/OElu/wSLYVlbs/W isnq4aJ8x7LA70ijWSg7DmeKK73MTxHf839I4dCf9yohrs1ZXcw5EEwYssMrfhXy6GSl bCvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SvX9Aaqi; 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 a6si65077784pfa.227.2019.01.07.08.17.21; Mon, 07 Jan 2019 08:17:36 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=SvX9Aaqi; 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 S1730650AbfAGNBj (ORCPT + 99 others); Mon, 7 Jan 2019 08:01:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:49054 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730641AbfAGNBg (ORCPT ); Mon, 7 Jan 2019 08:01:36 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 63C0021736; Mon, 7 Jan 2019 13:01:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546866095; bh=yhQnisEEuN/SZaaio0jGsKZJTWWT8X9VWItVRaOZ7lo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SvX9Aaqi9vpk5DqoYJXq1WoJmjFoo4m7zISLHPRwfEpXpU1yYnYRhinPbbOG0zjpt VjshTXNYwpXYxzPtFripNbFQtoxXJboyJYz5VsoHhEDcZvZRJug5dtWHSMZGUzRDh5 DgdwAZ4H4E8GRltk23atG2KMv0rzd/zCd+JYeX9E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+c56449ed3652e6720f30@syzkaller.appspotmail.com, Jon Maloy , Cong Wang , "David S. Miller" Subject: [PATCH 4.14 009/101] ipv6: explicitly initialize udp6_addr in udp_sock_create6() Date: Mon, 7 Jan 2019 13:31:57 +0100 Message-Id: <20190107105331.079740240@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190107105330.372621917@linuxfoundation.org> References: <20190107105330.372621917@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Cong Wang [ Upstream commit fb24274546310872eeeaf3d1d53799d8414aa0f2 ] syzbot reported the use of uninitialized udp6_addr::sin6_scope_id. We can just set ::sin6_scope_id to zero, as tunnels are unlikely to use an IPv6 address that needs a scope id and there is no interface to bind in this context. For net-next, it looks different as we have cfg->bind_ifindex there so we can probably call ipv6_iface_scope_id(). Same for ::sin6_flowinfo, tunnels don't use it. Fixes: 8024e02879dd ("udp: Add udp_sock_create for UDP tunnels to open listener socket") Reported-by: syzbot+c56449ed3652e6720f30@syzkaller.appspotmail.com Cc: Jon Maloy Signed-off-by: Cong Wang Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv6/ip6_udp_tunnel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/net/ipv6/ip6_udp_tunnel.c +++ b/net/ipv6/ip6_udp_tunnel.c @@ -15,7 +15,7 @@ int udp_sock_create6(struct net *net, struct udp_port_cfg *cfg, struct socket **sockp) { - struct sockaddr_in6 udp6_addr; + struct sockaddr_in6 udp6_addr = {}; int err; struct socket *sock = NULL; @@ -42,6 +42,7 @@ int udp_sock_create6(struct net *net, st goto error; if (cfg->peer_udp_port) { + memset(&udp6_addr, 0, sizeof(udp6_addr)); udp6_addr.sin6_family = AF_INET6; memcpy(&udp6_addr.sin6_addr, &cfg->peer_ip6, sizeof(udp6_addr.sin6_addr));