Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9488200ybi; Wed, 24 Jul 2019 05:03:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqzR4Y8Exx7wCvozuDRY/54w6uBXr0PE66DOXUcF3MHwI7iAn7HsLyB38gnG5yMb6iyWVnAh X-Received: by 2002:a65:6104:: with SMTP id z4mr43959480pgu.27.1563969827328; Wed, 24 Jul 2019 05:03:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563969827; cv=none; d=google.com; s=arc-20160816; b=BrrdIyet1mt6eabBCbjWKPIwc8F1WIlJ5zQHhv/Jl6nTUPygAm7t5l7shUFqrhcGir qpQgFOm52d6JUDMfNG6O1+yPK+/mwj6+Ufs/k4l9dgdShL3h6FwsJQs3P2HKTDafoswd x2N++5bRjUOF9ndwOlA3ooz2kEyYTuu48zk5Mzyt8q9Ebr15WqlgEdWStnh4s30CBFpb C3FRsPUIEqgNKonunDX4KKnn+EC4C2xrhvh0Bdc4fX60qeW6NPmMMhuzRYN5wEhy5F94 o3chk/zbE/a7cINprd3u29CoXfUE1lX9NJ6UWFyOqQ7wQzWexGjavairj8PCS9z0x7k+ Q8MQ== 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=fgBnDeONsrPsR6OfUBb1T9zEd1tRU7w9Xv2NjDIJoFw=; b=CBycM+jg7Fu3mp1B3szwSQ3F8ta+FIR6WIpMSg/pp7lNAKBFDJbpYyx4prT0qAGb9r ZFh1Y2S16yY/PZH+PFk+Ol5FdVwWgpwtDVWhUmBJ5zccZSIJfI4alz8go9qkKQGh8RUW JSuTKflUGwoHPYjn6h/BQ0nt1bBT6Nqeeu92CMdDdgYCq9WsnL1fF0az8yi7Izc3aUVV bMLQ0u15Z4oWUPoKT0+S/XIvAu4pLMvytaHpcEnSojXMzKPS8+uneNeAvvK651kGO7Ps PaAOcjhfukmH/dqsgr6OK0ZVFPneSKv8KO6W3vZxR1/OrxwKRTHpG0mdPnLhmibMS/TZ Tn7Q== 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 m22si14732044pgh.190.2019.07.24.05.03.31; Wed, 24 Jul 2019 05:03:47 -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 S1727802AbfGXMBk (ORCPT + 99 others); Wed, 24 Jul 2019 08:01:40 -0400 Received: from cmccmta1.chinamobile.com ([221.176.66.79]:2488 "EHLO cmccmta1.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727483AbfGXMBk (ORCPT ); Wed, 24 Jul 2019 08:01:40 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.15]) by rmmx-syy-dmz-app01-12001 (RichMail) with SMTP id 2ee15d384881758-15cfc; Wed, 24 Jul 2019 20:01:07 +0800 (CST) X-RM-TRANSID: 2ee15d384881758-15cfc 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 2ee85d384882a7d-f1062; Wed, 24 Jul 2019 20:01:07 +0800 (CST) X-RM-TRANSID: 2ee85d384882a7d-f1062 From: Haishuang Yan To: "David S. Miller" , Alexey Kuznetsov Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Haishuang Yan , William Tu Subject: [PATCH] ip6_gre: reload ipv6h in prepare_ip6gre_xmit_ipv6 Date: Wed, 24 Jul 2019 20:00:42 +0800 Message-Id: <1563969642-11843-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 Since ip6_tnl_parse_tlv_enc_lim() can call pskb_may_pull() which may change skb->data, so we need to re-load ipv6h at the right place. Fixes: 898b29798e36 ("ip6_gre: Refactor ip6gre xmit codes") Cc: William Tu Signed-off-by: Haishuang Yan --- net/ipv6/ip6_gre.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index c2049c7..dd2d0b96 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c @@ -660,12 +660,13 @@ static int prepare_ip6gre_xmit_ipv6(struct sk_buff *skb, struct flowi6 *fl6, __u8 *dsfield, int *encap_limit) { - struct ipv6hdr *ipv6h = ipv6_hdr(skb); + struct ipv6hdr *ipv6h; struct ip6_tnl *t = netdev_priv(dev); __u16 offset; offset = ip6_tnl_parse_tlv_enc_lim(skb, skb_network_header(skb)); /* ip6_tnl_parse_tlv_enc_lim() might have reallocated skb->head */ + ipv6h = ipv6_hdr(skb); if (offset > 0) { struct ipv6_tlv_tnl_enc_lim *tel; -- 1.8.3.1