Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3533945ioa; Tue, 26 Apr 2022 05:36:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEQI3qWmpRPEOOcES/lYGf0o0/asanQa2RpTtwS94a36+oS6YxFUj/hVpn4gPaZewZ7KBH X-Received: by 2002:a05:6402:42d4:b0:412:c26b:789 with SMTP id i20-20020a05640242d400b00412c26b0789mr24753027edc.232.1650976575949; Tue, 26 Apr 2022 05:36:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650976575; cv=none; d=google.com; s=arc-20160816; b=Rtx0Cagbs1ZyjJDKyWZmn7VwWOI4IV3CL8S0jE5pnVAbktTrdtCNDzrkHebPY1mOOb PeoB/3nueVxB/5T1mdeZiTy2q5MmW7ebiFcSml/oy4HEEnSL8AXtjI70u//Wb3sa3jR7 /WG21dvhEn1MLvI9zdz50mJJYUdD+92g4fLA4Va010vVJ5WBUB7wwsESOePzRanvi/5k Gj776ZbJSfA0pwnRYl7R+1ny80a7RLiQiitOPRRsQsFwAuBunjuj3hVjuEzkaBzc23x+ DmCtWm6oLPHUsanKIIXDcY8L3HRVLzliOQ1OQPL2oKTmg7EKgQDO6XI6zMlZeqrXn/iD AeIA== 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=6cMa8pgZ9k6oz2JUuZfNvDc/2rAtP5457iWhtU9bnTU=; b=ofiTgfggNEmzbzGhbjAzD0in4/qtjB2uMfvkNASbylPCsUAedsRx5ekcID8LbchME8 CFzjsmGD4hG0pqV7MXyg37yZ3g7fCNVARpyy46x56dPS0iY1Foarckk1GqRaCM6sIPtW ATH9pKck6EHXfAe9rGpF2laEw33EaUs31Mjz8vgqh0o45UU8cenPGSBBlNEKe+GBs0QJ Mi9ROwLWZMBYW2lulnbLX0MU7UHT6rbvxi0zn6iWw3u/1psiimIxy+zPNiYTVNqL9/1J SH+WkAKh4YQufwe+bZZn69nLtfYkuquhe0sko5py2Xy9IqF5bJfjFzjmKCZ5MaJnQG4C uMHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=esFXcL9X; 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 g35-20020a056402322300b00425fda09645si1120679eda.262.2022.04.26.05.35.52; Tue, 26 Apr 2022 05:36:15 -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=esFXcL9X; 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 S1346738AbiDZJJB (ORCPT + 99 others); Tue, 26 Apr 2022 05:09:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346221AbiDZIt6 (ORCPT ); Tue, 26 Apr 2022 04:49:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05256C7EBF; Tue, 26 Apr 2022 01:37:59 -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 6A6AD60A67; Tue, 26 Apr 2022 08:37:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65F01C385A0; Tue, 26 Apr 2022 08:37:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650962278; bh=CNOrExejcAtrT2uI/EvTsxM/o0aOOv5V/6eM/dQIZFk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=esFXcL9XtfPp7Y9Gw2Ul/ptMgjdhsYjwcrR8d7doyFN5FiyESXda8s/vY0jT4TQ+e pPAhitrpVppOOusSnt76PLfqVoBXUYML5rOgDVTWWtyEHaETTPF0ZHNQY8Xm4hRKcj 1YV+8SI7wb/N5fLthq5+5vE+7gCprplrPum41K+c= 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.15 036/124] ip6_gre: Avoid updating tunnel->tun_hlen in __gre6_xmit() Date: Tue, 26 Apr 2022 10:20:37 +0200 Message-Id: <20220426081748.330188844@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220426081747.286685339@linuxfoundation.org> References: <20220426081747.286685339@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 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 466a5610e3ca..288720838329 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c @@ -743,6 +743,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_txcheck(skb); if (IS_ERR(tun_info) || @@ -760,9 +761,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