Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10419739ybi; Wed, 24 Jul 2019 22:54:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqzxbg3brFNYpnSb2s9LfTpcJSok24FwzNmmywlPJkg2bZwxLcTdVY9hsNwraO1KYO/fgPlF X-Received: by 2002:a17:902:d20a:: with SMTP id t10mr38868672ply.226.1564034051506; Wed, 24 Jul 2019 22:54:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564034051; cv=none; d=google.com; s=arc-20160816; b=ENrG4VXaJlVU8ssk5OM24UyGhP/XybKlNJ8KhiaEOsqv50aROrvtqFHx5S1OpCFFdk MjQ0HSIVqvQqIs+VXaUPcoCo2C53xWvV4eRHINF5i7dWyu0rsdTC7JHN/yU7GfGB1Ncb tKJ0anR3oHu77/S0Ksi4Ygwk4qq1jIrpKJDWK9u8mC1zffhZjOW0wVtzDITrE2+n2kN5 9A6Zek7T5nQr9s32fU9wkBHnip5g29f7FHuyR9BmAj9JIYWDd3D88sKFi8gHEBhxnd4K yFCGrM/DbHUxnpmWU9bc37oeWRR0LFw6gYGDVt18j2owQJgDtT5fv/MapteZGXt1pGoU UTQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=Zw6gyhtQwnJnEwJrGyjAfGmMuLxWTirlj8VEwpbb+7M=; b=ZUWMYBauGd20K/RUvThpjJvci+EXNCGeh0LratjIM5Dwzs4k5HigQabRGZtyGhIxtN UcHYgiCnkFIMVgrbu3N4kziCm+mRcM3ErjUv0RudB3cC5H63U2CYitE4wgDr7nnqTh3T uKXMYmw51F+q3uyAji6q9/Ti5pRtHeUfHNkmf/+LSUqLR/uQtnlUHWis4N1lQWnWTTOo 9apAA2VXhVJS9y/9adn6lsCscxDJP2P3u7Ueo7/LxUPxEPkL2Q3WCB6r1nxWTlPuw4Rv 6KplfEr6gyVOLuMVwQ7A3T9PJW8ZR0QOIo8rwn0mUlDvN5q4uVz0hOKF4X/V/p+9k4Qn 5Ovg== 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 15si9986128pga.575.2019.07.24.22.53.57; Wed, 24 Jul 2019 22:54:11 -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 S2389664AbfGYDJC (ORCPT + 99 others); Wed, 24 Jul 2019 23:09:02 -0400 Received: from cmccmta1.chinamobile.com ([221.176.66.79]:2114 "EHLO cmccmta1.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389532AbfGYDJC (ORCPT ); Wed, 24 Jul 2019 23:09:02 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.17]) by rmmx-syy-dmz-app04-12004 (RichMail) with SMTP id 2ee45d391d45286-208c0; Thu, 25 Jul 2019 11:08:53 +0800 (CST) X-RM-TRANSID: 2ee45d391d45286-208c0 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost (unknown[223.105.0.241]) by rmsmtp-syy-appsvr09-12009 (RichMail) with SMTP id 2ee95d391d44b50-2307c; Thu, 25 Jul 2019 11:08:52 +0800 (CST) X-RM-TRANSID: 2ee95d391d44b50-2307c 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:56 +0800 Message-Id: <1564024076-13764-2-git-send-email-yanhaishuang@cmss.chinamobile.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1564024076-13764-1-git-send-email-yanhaishuang@cmss.chinamobile.com> References: <1564024076-13764-1-git-send-email-yanhaishuang@cmss.chinamobile.com> 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