Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp7229811ybh; Thu, 8 Aug 2019 12:10:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxSaICBvEO2ahZbWq2GmzrA3/jLu4h+w+F/7Esh4ysnDn35MRAyC+o8mfUW57FSEYg45gVb X-Received: by 2002:a17:902:9041:: with SMTP id w1mr15522716plz.132.1565291444568; Thu, 08 Aug 2019 12:10:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565291444; cv=none; d=google.com; s=arc-20160816; b=cb0LwilLTprzwd5m/b0gOmq0bXMyzHqpAvD951CqIa6/gVS5xwSDYWLnKAkz7dV0Fj txkvu7n7kaXocmFXlS45kSZXK0mjBj09eqrGxH77tAY1d+4fqi1+gNQ7tgJ4ncwHU0m0 ZhbiOY6lpETE7xr2ol3ognSpQmqX8I6wG4pmLnl7mUzADJ7GcS3oG1ffqWS13tCts+or WWVI8jqfBq2tH1sqrLSYfOZjn2ZB2qeu7fOMpr+cCNkwpXfA7mEEnvmXgRXv/uaEqs1/ GldCjPtiZ1YyDDBVjvyOhu0ocdg2DKm0zxkiBqjifydgGG4hjI8L+bo/bOilabhxvPjV 7kbA== 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=y3aGsvS+Ia5nyPPkyyzadomRakrtdjUPEU8fGbh3QCs=; b=Nzxj17HaB5MujpCXzbBh7YHD/bnvXgTLmkvkPz5OgI/D0BPh97Mu5telS1mqjCIHVU kp8wkKrYgT1ZKayVxoXbMW97glaajpOzqLvdCaefN7p5wQbI0hzpNsNqYTepC+JWNVj3 tEoQjGaDcJQeBoNZVlSwgs6FpaJI4wCGjgrYd2yCP2gdZWXNleyvTkt+JVRozzrJtXEi qKSdVnF45cN//eqe1+/LW5jOpRo2xd9wTR70OclzZcmk2pysXDWiZUHCTLdtIDARA36o 4hY5HkTPXVgbpGT+nY3hkzf6lKLzcpxWQCXx+2PWoXHeFY+9Ty0SbA85Se3Qulaxt0J+ aY4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qiqFXIDk; 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 p33si57732919pgb.0.2019.08.08.12.10.29; Thu, 08 Aug 2019 12:10: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; dkim=pass header.i=@kernel.org header.s=default header.b=qiqFXIDk; 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 S2405057AbfHHTJK (ORCPT + 99 others); Thu, 8 Aug 2019 15:09:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:43404 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405045AbfHHTJH (ORCPT ); Thu, 8 Aug 2019 15:09:07 -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 6FA5021874; Thu, 8 Aug 2019 19:09:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565291346; bh=L1UbzN2FbxpMe/YNMfeHccBGcpbxvsiodflnULxUm50=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qiqFXIDkkAnTUbC3AMUEFPBclya98BzADmMTTDWBoTkAAKwSEaPOnJ/1fPxLB4VV8 fVz0iRcPIBfPId5Sg/1EHc514J3G3T4eyvL/S+6ge+7RDEAAB/sbSt5LuQLHcrednF +6rcE2UY6RE85E6fbMhuWijEfAxL5sQxJDkHW6vw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Haishuang Yan , "David S. Miller" Subject: [PATCH 4.19 17/45] ipip: validate header length in ipip_tunnel_xmit Date: Thu, 8 Aug 2019 21:05:03 +0200 Message-Id: <20190808190454.703655997@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190808190453.827571908@linuxfoundation.org> References: <20190808190453.827571908@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: Haishuang Yan [ Upstream commit 47d858d0bdcd47cc1c6c9eeca91b091dd9e55637 ] We need the same checks introduced by commit cb9f1b783850 ("ip: validate header length on virtual device xmit") for ipip tunnel. Fixes: cb9f1b783850b ("ip: validate header length on virtual device xmit") Signed-off-by: Haishuang Yan Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv4/ipip.c | 3 +++ 1 file changed, 3 insertions(+) --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c @@ -281,6 +281,9 @@ static netdev_tx_t ipip_tunnel_xmit(stru const struct iphdr *tiph = &tunnel->parms.iph; u8 ipproto; + if (!pskb_inet_may_pull(skb)) + goto tx_error; + switch (skb->protocol) { case htons(ETH_P_IP): ipproto = IPPROTO_IPIP;