Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10418880ybi; Wed, 24 Jul 2019 22:53:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqx69PqLU4l0MSyPdvYMeQKOAEXBzaUytimfNlQCMXrecsMKvzOMsKhW4v2qpghVyiWK/0Do X-Received: by 2002:a62:cd45:: with SMTP id o66mr15197098pfg.112.1564033986517; Wed, 24 Jul 2019 22:53:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564033986; cv=none; d=google.com; s=arc-20160816; b=StKnxCRkL/pJganNpKBvOuZhW+vjVdZoyR+XyX6zBC6y9ArhP5H2U5PZG7Qj9rhVNb IqwR4V0j+zGbx4j9QiXL7nHcCIiAmR/xl7V5Abd2v49XxUnXVVxDtShJrE7OMXsAIYzh Rjc4/ZHEpvJOdhTlERIhK8rzG/Hy06N2FOT+b46hG8ZYL4GoKgbXNCPEEsoE2rJTkw7D xANYgm3wczaexPiWPw4X+iMSGYU6YvDpCn37iT31eHn7HdCtymFOMH5XlAKESBoMquq1 8aa6p+BpexrGHqvlCtyw+/gRJ9n552RPtfxCbi+Afe9xUSKO1+z1nixEPMshQH1+Tpk0 o75A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=Zw6gyhtQwnJnEwJrGyjAfGmMuLxWTirlj8VEwpbb+7M=; b=U5RQbpkTNl92zzNfRPIEYV79pyHFbbkhWJ7R1vM/7+s4FmwHwst/ybsoIHZdAlbAaP fs2xBkiYSZ2ziTuyb+YXnG2z4o4NyPymEuBshLPSOHYpz7kGQF7MVev8wqhLoH0e5Ygq DQQ869iodUDeCVqPOTqL6V+FRfQ8+lXS5k432bQ8z92cKhKrWvJ/YxLDEdVF0TjX5LLi Ly2NqTwX+t42rZbiPffI2UAbEj4wotvDmTrVp90QTbq61mumTnVt8SkSPZBDxQwBwgko 8uufXLsV8UY0rjSS0kFlGwnWSsgHBS5VGAghjVKcbBksvoaadrrXmAH8KIMiJZgwZqr6 7rhw== 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 q3si16654793pjb.1.2019.07.24.22.52.52; Wed, 24 Jul 2019 22:53:06 -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 S2389699AbfGYDJr (ORCPT + 99 others); Wed, 24 Jul 2019 23:09:47 -0400 Received: from cmccmta3.chinamobile.com ([221.176.66.81]:21108 "EHLO cmccmta3.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389532AbfGYDJq (ORCPT ); Wed, 24 Jul 2019 23:09:46 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.15]) by rmmx-syy-dmz-app11-12011 (RichMail) with SMTP id 2eeb5d391d3f18a-2076e; Thu, 25 Jul 2019 11:08:47 +0800 (CST) X-RM-TRANSID: 2eeb5d391d3f18a-2076e X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost (unknown[223.105.0.241]) by rmsmtp-syy-appsvr08-12008 (RichMail) with SMTP id 2ee85d391d3eb26-23857; Thu, 25 Jul 2019 11:08:47 +0800 (CST) X-RM-TRANSID: 2ee85d391d3eb26-23857 From: Haishuang Yan To: "David S. Miller" , Alexey Kuznetsov Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Haishuang Yan Subject: [PATCH] ipip: validate header length in ipip_tunnel_xmit Date: Thu, 25 Jul 2019 11:07:55 +0800 Message-Id: <1564024076-13764-1-git-send-email-yanhaishuang@cmss.chinamobile.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We need the same checks introduced by commit cb9f1b783850 ("ip: validate header length on virtual device xmit") for ipip tunnel. Signed-off-by: Haishuang Yan --- net/ipv4/ipip.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index 43adfc1..2f01cf6 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c @@ -275,6 +275,9 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, 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; -- 1.8.3.1