Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2057928iob; Thu, 5 May 2022 14:36:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyX4pU06gE6CbLivGD+YrlPO0d5opMVDpdQdTVmHCyAfefuN+FKkAB59r/IAiaQ2A4vJ6XU X-Received: by 2002:a63:5c58:0:b0:3c2:f183:cbd7 with SMTP id n24-20020a635c58000000b003c2f183cbd7mr85360pgm.33.1651786616754; Thu, 05 May 2022 14:36:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651786616; cv=none; d=google.com; s=arc-20160816; b=nDF7ZVphmzQbPTObo4R0Dvh8EqGy5aXvc4tGxE246XRsKalLyYTKYWtOAres/sqPqW 1Gt99/zFQgZTr+CrlsYt7FQh0znseQ7XyWFxkDQGprv4/KWKuDC2JqDMobI3l1fCK10H Xc0M4iTe199XTY6Mr6f5pZLjYRs1p3jdSQpfvvkqcXlO2yfSD7Pz4cVMH6rEQPDPFJK8 BOyf12KJp4xXH4S933kKSXk/JfGvuE4nfCM2+eYa57KQ36A8PLlqxYJ7+yTFf+M9+NU3 HjyOy1W4YiZx5qA4NjPTBBT6mb1LSYlly8G9o/rXkVz3LoJiUebNmaasqWsrQkYJbehG pk/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=042mz7FftQup/XHMDccdGEjjJ+QmZNoxhfmNtFHthq0=; b=f6CYZt6TVbFzgwG7bBnfWYztEeG2T2PRXUGDwK/QQuTu8Fyrr+Z8yQUYXwPx3yYm+v qQFAomUNxEwIY4FB8vS7RmKq8A7qzLl2AZ2JZ61RRA2mdh09/C5XZKpvM/cbNtptZArm KkXmXnWaLTHLpzFiIhztEMfYkWFnsKUxSQ6w+93+ve1ycwD1Hh9XVpOyzFTOTMaSxP9E EFHE4ANSEbVsLRpvFFTWV2IGWGmXw1A6n/+taJBZG5etpG6EHkJBUYDX2HvDhsuiw98r IIpNCi7ZoBL8bd/0OwlwBcBjGiO7TUZn+l+9neTOY7dKroQ49sQ/K4prXzuViHhpQ+Hq xN8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sW2YAVF+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c11-20020a63350b000000b0039dae898c4fsi2885443pga.220.2022.05.05.14.36.43; Thu, 05 May 2022 14:36:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sW2YAVF+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354326AbiEDQzk (ORCPT + 99 others); Wed, 4 May 2022 12:55:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354175AbiEDQxy (ORCPT ); Wed, 4 May 2022 12:53:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C764473B3; Wed, 4 May 2022 09:49:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5D15361720; Wed, 4 May 2022 16:49:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A174DC385AA; Wed, 4 May 2022 16:49:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651682950; bh=MHT2SeQdtx3XYjhw3wAw0mbMJj9Ahj3yxOPq+fIpods=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sW2YAVF+JuMlfjV3AKrwb+T3DRXU5sCfpHLx/+kJUGV3EQU3rxTUf0YP7IZ5fSt7G DhZCivdIBlP47PYX5FdNcqU1LPqOxU3vRI/wQ9RjckWN+s080H6ehGTQ8JTIxYP2jf TfD6WkWiRqqpJHUjXOZOHELEnLjKJPm0P/Le3uYI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Cong Wang , Peilin Ye , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 69/84] ip6_gre: Avoid updating tunnel->tun_hlen in __gre6_xmit() Date: Wed, 4 May 2022 18:44:50 +0200 Message-Id: <20220504152932.856314841@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220504152927.744120418@linuxfoundation.org> References: <20220504152927.744120418@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peilin Ye [ Upstream commit f40c064e933d7787ca7411b699504d7a2664c1f5 ] Do not update tunnel->tun_hlen in data plane code. Use a local variable instead, just like "tunnel_hlen" in net/ipv4/ip_gre.c:gre_fb_xmit(). Co-developed-by: Cong Wang Signed-off-by: Cong Wang Signed-off-by: Peilin Ye Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/ipv6/ip6_gre.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index 5dbc280d4385..e550db28aabb 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c @@ -730,6 +730,7 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb, struct ip_tunnel_info *tun_info; const struct ip_tunnel_key *key; __be16 flags; + int tun_hlen; tun_info = skb_tunnel_info(skb); if (unlikely(!tun_info || @@ -748,9 +749,9 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb, dsfield = key->tos; flags = key->tun_flags & (TUNNEL_CSUM | TUNNEL_KEY | TUNNEL_SEQ); - tunnel->tun_hlen = gre_calc_hlen(flags); + tun_hlen = gre_calc_hlen(flags); - gre_build_header(skb, tunnel->tun_hlen, + gre_build_header(skb, tun_hlen, flags, protocol, tunnel_id_to_key32(tun_info->key.tun_id), (flags & TUNNEL_SEQ) ? htonl(tunnel->o_seqno++) -- 2.35.1