Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3285140ybb; Tue, 31 Mar 2020 02:05:54 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvZG2tW95jMEoAFiULmdrSIqJTIsLjUn/5XlEfTtYOuxk4tbJMSzEM3gC7dcw2mqBvb+olD X-Received: by 2002:a9d:1921:: with SMTP id j33mr12531039ota.309.1585645554154; Tue, 31 Mar 2020 02:05:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585645554; cv=none; d=google.com; s=arc-20160816; b=mD3rFDNpw6rxq+1zFRl3V5U9uF+2mMsxH1MSbOXNbem7QS+bW6mi3PtK5OCKAw6cDF V0vOZjS78Ye32nR0y48Ljq+H4W40B48nunF+bL8MkjkkSbCPxT0VI0Jzoze6gxdJP+nX myM6Nes/0CQwOHuYSciqk4rfF1KSAPER1mQ1hx6myM6cHbH1CdT0DXxWj8xPgQktAWfL 7nvlfFKbi8dlKe9enH/yY1z9n8fDKklnkYB88XYIRZC69qAPPTOphLDcF6hPp7fMQ8yF XV7juwBf5kbzEOJ/O1ytAF+BHeHBo9ZoLTZ8vnxCBo9E+ETQtouSaP9ZQUjuA5CdqOFS u0jw== 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=h6JZwPvfl4Dd+YyBHvYVo5QeydEZEwK7zCLx2/+1FfI=; b=kiRENtJWnNuT8B9UgRrWonMhpwoNftT2F/YuXA8XeCYRhSBkPGaq0QIA2TPbaWz1yz bIL2OgujLqnVdxaHQE0wiBC2KRVcpHz9mlTOwkUgJiX19F26loBR2wg2rx9gVjjTTWS5 jAwHOFDDvIpOxWIJ7k3gJT/E/4dkhx5SKycW5kvz6/xJVTuh5EOJeUT9RLdmEreCcArP h6T3Riq2EKTF5Wv4FC+evhy6GVCJ9SzQJw7XdErbydv8+aX+MWp0nTynDzIEil30ezJm cHv+Q0u2VHL1r37rKa7t7SV5ZBpUX5I6hcvrvFHCNmUrjG/jFfPzzrQH1ejvy28RP160 mZpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gKEzAhIw; 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 k201si7218441oib.94.2020.03.31.02.05.42; Tue, 31 Mar 2020 02:05:54 -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; dkim=pass header.i=@kernel.org header.s=default header.b=gKEzAhIw; 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 S1730888AbgCaJD5 (ORCPT + 99 others); Tue, 31 Mar 2020 05:03:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:43712 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730391AbgCaJDy (ORCPT ); Tue, 31 Mar 2020 05:03:54 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 CA69E20848; Tue, 31 Mar 2020 09:03:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645434; bh=a1HpEXRZ/5jojKy5rJX68A60mq6WMRfNlUiyOa9yo+U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gKEzAhIwLi3reu3Ky5H7XSHRNSSpelb87Wn4txoYxgEQk2fhmkZmrQkJq/IgLyYO6 kjhYpQv3+WhjbTOVP2p0x8uZss5VTJKv0vuoyaurHkJdaD3CVimMrneisIi8twGjBY 1+GRsr/PyQTOw6QNQcnEcvFYO/RvmHrF8m1ILToU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+1b4ebf4dae4e510dd219@syzkaller.appspotmail.com, Petr Machata , "David S. Miller" Subject: [PATCH 5.5 052/170] net: ip_gre: Accept IFLA_INFO_DATA-less configuration Date: Tue, 31 Mar 2020 10:57:46 +0200 Message-Id: <20200331085429.946718195@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Petr Machata [ Upstream commit 32ca98feab8c9076c89c0697c5a85e46fece809d ] The fix referenced below causes a crash when an ERSPAN tunnel is created without passing IFLA_INFO_DATA. Fix by validating passed-in data in the same way as ipgre does. Fixes: e1f8f78ffe98 ("net: ip_gre: Separate ERSPAN newlink / changelink callbacks") Reported-by: syzbot+1b4ebf4dae4e510dd219@syzkaller.appspotmail.com Signed-off-by: Petr Machata Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv4/ip_gre.c | 2 ++ 1 file changed, 2 insertions(+) --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -1168,6 +1168,8 @@ static int erspan_netlink_parms(struct n err = ipgre_netlink_parms(dev, data, tb, parms, fwmark); if (err) return err; + if (!data) + return 0; if (data[IFLA_GRE_ERSPAN_VER]) { t->erspan_ver = nla_get_u8(data[IFLA_GRE_ERSPAN_VER]);