Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3668998pxb; Mon, 24 Jan 2022 14:56:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJxH1iBX3xNLKsZ9nkvxX80P7YYinHN3dV6BnnvTDcyPJNyoLxxYrSsFSFmR2P4r5Kb4iZfA X-Received: by 2002:a17:903:1103:b0:143:a593:dc41 with SMTP id n3-20020a170903110300b00143a593dc41mr16204140plh.5.1643065011517; Mon, 24 Jan 2022 14:56:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643065011; cv=none; d=google.com; s=arc-20160816; b=MMRYT7MLLeSYt4pagWRoTOd+EX6BPjvt9SZcQxi0q4BiOoA0NpqUeuypCOLGshjLW+ HMPS73lQECd1y2AX4PCiapkkmmk321wpmZs3w39ePIC45AH2SleI5MtJ5kSww2rlZoBQ 4zhVDez/Wly3DEBZ7QwHSd1oAIjzdmwXEsoufv6iz5z7Ijkoitkso+ueVKBn/U8sgdYc dwJRXyOpM7Tf1RmBT7D+AbsunfNogmdlcGpq6gxg9xL5SybSvUTFzHn/8DKvXF9Q7A1x tOP8G3Ek5NqCIv+3BDZnTXvy08pSwS6gypkOc0feTzY0/0g4KFVuiBaIGM0T12vo/PGo /n+A== 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=NCV2yjsX8AXpoAAGljDe795bumBzO1bwPg4NBLtf+8E=; b=vo9p2+95gPcH5HeCd+2JQBLP2yiNdJCHMUc6MP8O4U73SgZOpFmpRMBN/N9MaMD/ds FVAKSf74Kc4FGJsKQX+BP4G+WV04BeD95gsn11cS6Gbd51qw6XjTH6jlEbP81SuYEYur JZhzsGHe3fA3L353JJjN6/iwaLGitfzZOFL+PjsQVEtXQVy3yXFePtFeF/eG/uwRp8cH 3u7v8Q6NsEzt6ppwBkqxLV025Cb7S1GWl97XTDIRsx40HbeEBOF97NZ3xyUzDQbUOphZ sNogVyaWlTKaO6Fitm1pS/3zQmEYQ5LDUR4aiai9+aoZRqTYrxN/FllHe408ED9PRpl4 uiaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lsXUEg5Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u12si4347193pgb.667.2022.01.24.14.56.39; Mon, 24 Jan 2022 14:56:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lsXUEg5Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1839608AbiAXWv3 (ORCPT + 99 others); Mon, 24 Jan 2022 17:51:29 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:59280 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1458117AbiAXVmq (ORCPT ); Mon, 24 Jan 2022 16:42:46 -0500 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 2ADE76146A; Mon, 24 Jan 2022 21:42:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F1618C340E4; Mon, 24 Jan 2022 21:42:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643060565; bh=HMgHsusz66jvKUn2q1i3T3oRyyk+TIy9VI2jBQLzg/w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lsXUEg5Z5zTxBRQhKox9l0VoJyq3XKxX+Z/oPLkfO3PovbqouYYvFY8AkaMJkuJkj 6b5Z0jRIokp+BR7+SGPyYqPEuy6rpGZTShd50p5NWrKNVyC8yx6bo31DsY4EkIkxe+ uEyvXh1Mfff6aEE+KfxcqMugX1btaCUQfLk6Eesc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guillaume Nault , Jakub Kicinski Subject: [PATCH 5.16 0991/1039] gre: Dont accidentally set RTO_ONLINK in gre_fill_metadata_dst() Date: Mon, 24 Jan 2022 19:46:20 +0100 Message-Id: <20220124184158.599754506@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guillaume Nault commit f7716b318568b22fbf0e3be99279a979e217cf71 upstream. Mask the ECN bits before initialising ->flowi4_tos. The tunnel key may have the last ECN bit set, which will interfere with the route lookup process as ip_route_output_key_hash() interpretes this bit specially (to restrict the route scope). Found by code inspection, compile tested only. Fixes: 962924fa2b7a ("ip_gre: Refactor collect metatdata mode tunnel xmit to ip_md_tunnel_xmit") Signed-off-by: Guillaume Nault Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/ipv4/ip_gre.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -604,8 +604,9 @@ static int gre_fill_metadata_dst(struct key = &info->key; ip_tunnel_init_flow(&fl4, IPPROTO_GRE, key->u.ipv4.dst, key->u.ipv4.src, - tunnel_id_to_key32(key->tun_id), key->tos, 0, - skb->mark, skb_get_hash(skb)); + tunnel_id_to_key32(key->tun_id), + key->tos & ~INET_ECN_MASK, 0, skb->mark, + skb_get_hash(skb)); rt = ip_route_output_key(dev_net(dev), &fl4); if (IS_ERR(rt)) return PTR_ERR(rt);