Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3564405pxb; Mon, 24 Jan 2022 12:19:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJx998T5Mv3MO845/kO1kLXz4ce8QwoEiDMi4WMu+Qc1FiSEhZs5/aZ/wxvhOwqBfkxoUhng X-Received: by 2002:a17:902:8a89:b0:149:a833:af2a with SMTP id p9-20020a1709028a8900b00149a833af2amr16245290plo.153.1643055437938; Mon, 24 Jan 2022 12:17:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643055437; cv=none; d=google.com; s=arc-20160816; b=Y4r91QE+wSkjdrFfYzh5ZV6mT7EXfTVSmngDl69vzrPL3cB2S6Tv+35prt+bqJpjqe 5HqwM6aYFtKA5sPsmwSxEEkpmClhh0kRKAEevHyRXWk65/FGKDYQEShYGpD8GqmTF0jF KO9q0KAcuLB5RCMvGtX0J/QGOKWQv9AW/mqYAn5nc72qNTdp6QrI0DICQFnfxN7eysjU 5mj9lSHt6AL7lO2z4ZjBlIG/V96mplKTkvpfckrO3P853TMnNZmWpd2+wnNmMFiH7TlN 8DTRf3080cvJoU78RpVTmZyLLADsUdKrlv8u1gfJYpz/iA5Cay/ev0Er36aCWH0FVqsQ gsfw== 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=+cZWoI7oNw4Ipg9V8nEvOLWvpIIIs96IFh2+7ng4d3E=; b=SKPIbR0nPe6HrTCDJpPl9+t2AovJZVppbogxHYXm9CFPRQNVF6W/4jeliz9wEdrltX yZ69mQ6Y7FxU93y/9Bs27c0VaJPt4sNoKyoVPMSl8fg2eoNzeUq3elNkivz9iaeWhzt9 7ZuXKxz3nhUzczXs1ImsnXEQWPYfcD6LXZo1MNolbglgS5qlvkOLkpR10hVRFvQrYo3h eRk8fMl1zIYPng2HhC3htBMzKQcC9/wcEikKt3Ppx0WdXA6XMZ6EX/lAB6Uj5c+GxYod DElui51fID0YtUXZDClobouNZM17x4WENPc54QVj5DmtpFEvevtgSg7bjGbk8gGWWkRl orgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zb51iuiv; 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 a4si248120pjs.172.2022.01.24.12.17.05; Mon, 24 Jan 2022 12:17:17 -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=zb51iuiv; 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 S1348853AbiAXTTr (ORCPT + 99 others); Mon, 24 Jan 2022 14:19:47 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:37356 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347787AbiAXTLK (ORCPT ); Mon, 24 Jan 2022 14:11:10 -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 ams.source.kernel.org (Postfix) with ESMTPS id 451AFB81232; Mon, 24 Jan 2022 19:11:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5DC1DC340E7; Mon, 24 Jan 2022 19:11:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643051467; bh=DthYjh+AUf6U0msGHmNsk3EuOaLtsWRn1QyFhfakDLQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zb51iuivRtVdWVwNQN83Eo4upmNDdauGY42iXkxDnA5TlvmuT+fZ6OCm6rnrkRZqq 9RagJTNOmmLpoHsKe/Ed5jG980Qte65SQUwJBLRQD7vcGopZFXO02fk64gPryp0T70 twSl08Pu3H/Mgx5sBZIcm9XiNuM06BL/Cr4PP988= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guillaume Nault , Jakub Kicinski Subject: [PATCH 4.14 171/186] libcxgb: Dont accidentally set RTO_ONLINK in cxgb_find_route() Date: Mon, 24 Jan 2022 19:44:06 +0100 Message-Id: <20220124183942.616265035@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183937.101330125@linuxfoundation.org> References: <20220124183937.101330125@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 a915deaa9abe4fb3a440312c954253a6a733608e upstream. Mask the ECN bits before calling ip_route_output_ports(). The tos variable might be passed directly from an IPv4 header, so it may have the last ECN bit set. This interferes 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: 804c2f3e36ef ("libcxgb,iw_cxgb4,cxgbit: add cxgb_find_route()") Signed-off-by: Guillaume Nault Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.c +++ b/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.c @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -99,7 +100,7 @@ cxgb_find_route(struct cxgb4_lld_info *l rt = ip_route_output_ports(&init_net, &fl4, NULL, peer_ip, local_ip, peer_port, local_port, IPPROTO_TCP, - tos, 0); + tos & ~INET_ECN_MASK, 0); if (IS_ERR(rt)) return NULL; n = dst_neigh_lookup(&rt->dst, &peer_ip);