From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAA8DC32754 for ; Thu, 8 Aug 2019 19:06:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 827B321874 for ; Thu, 8 Aug 2019 19:06:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565291170; bh=WLBYh0GoRhp9dzJDdv30zfp8sCdMj1MIp8GArBRONlE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=mvjcVqXBPiN3KLe3NSymIv0j8iBUJHvbuBCo/0D/DwXdQL0fLGl918nLZuGmRsCDI 4/aOb6nG7PqSSDRELZPia5G16I+ImNvmFRQ0VTUYMheJ12CxZaS8HnLrBGXZwu3iY5 vvgq07YqMElxPYsLSkPlUE9sZbLk+fwYh3U5TfkE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404292AbfHHTGJ (ORCPT ); Thu, 8 Aug 2019 15:06:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:39442 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404196AbfHHTGH (ORCPT ); Thu, 8 Aug 2019 15:06: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 352012184E; Thu, 8 Aug 2019 19:06:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565291166; bh=WLBYh0GoRhp9dzJDdv30zfp8sCdMj1MIp8GArBRONlE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kUSCDxGxn1EOFzUfm/HXow9Mf6GDPoJjzwk8FfaQMPfd+JN/oBoGC81B9MbfNZXqC 1EABAV/S5wRVYDIbaWAybs5H45prZe4ecaisPAyiL+JQGk006c3NPxGKunJITbhBfl kTTTWhQrKVyFfUA+6IJpjYk+aw3Z/uNmXtTmY4VQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, William Tu , Haishuang Yan , "David S. Miller" Subject: [PATCH 5.2 12/56] ip6_gre: reload ipv6h in prepare_ip6gre_xmit_ipv6 Date: Thu, 8 Aug 2019 21:04:38 +0200 Message-Id: <20190808190453.354245914@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190808190452.867062037@linuxfoundation.org> References: <20190808190452.867062037@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 3bc817d665ac6d9de89f59df522ad86f5b5dfc03 ] 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 Acked-by: William Tu Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv6/ip6_gre.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c @@ -660,12 +660,13 @@ static int prepare_ip6gre_xmit_ipv6(stru 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;