Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3685259pxb; Mon, 24 Jan 2022 15:18:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBLMfvwUe21iSh8OFRa08YYJAZT7FNlD6G4E+0kIjd+po5Ni1I5EnfuBoN+x99NEMNw11N X-Received: by 2002:a63:2220:: with SMTP id i32mr13255406pgi.320.1643066329753; Mon, 24 Jan 2022 15:18:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643066329; cv=none; d=google.com; s=arc-20160816; b=Tv34RLtRCLbSXefqkNcZdTUuO1sWMeV7zmzRiPz5+0tbiXP8t6M27TndlmLH2vbH00 VHy63nnw09JOuLvq8UFqz7HL7bM4xw6z0ZZRZ1F1fY9DPrAbs3fSEtz/i/6wbyoPu4b8 SxfxuphxgQ6pLvlwzjAwCYyGLi3wYTFs+yI0Mkf/ll2zIwWV2StWMzQoFbzA/RXwYeMP uTUAyHNSnairCLJ76dpmCEW8kEs75Tgi7nLqlcSUIAW6AgGeKyFSIY2LLvUyNNL/1imV BUD0cDSNyCab8qafX0+HxGkQXCAvFoDXBYpgdAXWlDIhGgE3T/EoED6J+CCjZiQcnz/D TIlg== 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=uqc8C4LMjl7zieU5QkQk3J6a+yRvjC4KoYVFxGm+2jW+/WkAoPxj5ZV0TTe/wPZ11I GaU7cOdUoRwDEuyySvM232VnXOVpBdqqUQ0J3k9LQmWxEHIGP3c6e5ch8Q95VR7ho52e KeJpsbytJJ6sVEOf5c1h0xKHF8/caDgmY0fzgj8m8l3Wmk0Lp7LsEZM2pfPPQKwytMax /zcpgO2Wj0A9/RuVRcS6agV/s2Go3KuJmJRn9+NJ9tYE0OOGtnt68d0wWHWNQT2KWBSO 5UtbDQHRtef1eXDFtVmVjzt6JOnJP03YDETCAX4zcxnuz7zhF3tJxYaaa+rbyJOGodDY JPQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TjLPzmmO; 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 n9si14468019pgs.46.2022.01.24.15.18.37; Mon, 24 Jan 2022 15:18:49 -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=TjLPzmmO; 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 S1845460AbiAXXMZ (ORCPT + 99 others); Mon, 24 Jan 2022 18:12:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1584562AbiAXWVZ (ORCPT ); Mon, 24 Jan 2022 17:21:25 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0ECEC0424D6; Mon, 24 Jan 2022 12:50:38 -0800 (PST) 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 3DFE0611CD; Mon, 24 Jan 2022 20:50:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23F36C340E5; Mon, 24 Jan 2022 20:50:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643057437; bh=HMgHsusz66jvKUn2q1i3T3oRyyk+TIy9VI2jBQLzg/w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TjLPzmmOcU8LWFIsAfGYgwtIVYXMJHAcaYmw8/6jmyslejBmMTLKTEddM6Rycw+Iq kpDUB7v7eyhHk6YkxLKpv1rMCyYA0JVK12NNwTyrnEYTEY9WSxND6VvTa5OBx62Waw clkUw9Ks1BckixUVC4fvj7J1APO3nB8CBrQPvvXk= 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.15 812/846] gre: Dont accidentally set RTO_ONLINK in gre_fill_metadata_dst() Date: Mon, 24 Jan 2022 19:45:29 +0100 Message-Id: <20220124184128.925515754@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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);