Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3585441pxb; Mon, 24 Jan 2022 12:52:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJw3Mr0WUWIEEb48abRf2JrTBt4xBVs0PI6JFosDY3ZkYfv3JO9n/ZewiWIwXBT7Tf/RlLva X-Received: by 2002:a17:90b:1a8f:: with SMTP id ng15mr45456pjb.93.1643057527926; Mon, 24 Jan 2022 12:52:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643057527; cv=none; d=google.com; s=arc-20160816; b=QD+10vzgan8E0vnfo+Zw82TScRUY2YwoEb3tZeSvXe/jkoNy/zUkTOJYHnz9FO+JaP ug51QrGvmmU/kGzz2iWrSxlJs97lEI3TQdcTHdRTsVMyylIzqt0QyMW56i+APndBYeEg Jj7XJekrSNMWX/g7PdqbdqV/+jzjbHrztDIyypRGqREh14RuQgc3jsKc2m32LxUWlZwp w+2u3vEMBQ6t0nvPV68pz7cKxpJX/YAA4DR++hGnyN4XkrjwKO/Lku+Bfnh2mP/u3rdz PUgjd/pXntHizT3hTlh5yGHNGO7fwyokGFAu3iUXA2VRMzNJqtOT4wFCazQf1q+u4Hjw 5Hlg== 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=lsdO9CfAUlZUfyEaLjkEpMbEaQwqkfw2K9KTmtq6PYwFUROUK6+NNZj9ai3t2KRxUy zjjAQhLoMQZNN3x7G4y/3Zv7hjDbxOfjBU6KatZ4G58Vu5DJ+dmEUrDlXA/n7wRvF4r9 209WJYKzHBBgOslKCaTuQlyWl4iFJYMk18+nnschjTW9bccvvApZ1JSYgiAB1GO+Gh1G bBkWE6QHR4xzjTj9SBR7VmiNGgTX8JwWsdXbqYGwxCicbqHw0Nd4ar0TirB1mPEaBraD M3brKXVkG49UgNGBWo62DfkjRyvjP1M49j9JdtsPXo5pYuXa5ObISOD72pBUk3UkojDd ZdFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rWE5SqG2; 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 s84si5932183pgs.644.2022.01.24.12.51.56; Mon, 24 Jan 2022 12:52:07 -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=rWE5SqG2; 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 S1377746AbiAXUFz (ORCPT + 99 others); Mon, 24 Jan 2022 15:05:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244771AbiAXTsh (ORCPT ); Mon, 24 Jan 2022 14:48:37 -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 A3960C02B8D7; Mon, 24 Jan 2022 11:23:37 -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 2EB7160BB9; Mon, 24 Jan 2022 19:23:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8A36C340E5; Mon, 24 Jan 2022 19:23:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643052216; bh=DthYjh+AUf6U0msGHmNsk3EuOaLtsWRn1QyFhfakDLQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rWE5SqG2v1mFbW/+idzRSVNaom5Pn8Pv+hAIJXMKxrh984dj9b2Ib377bnqeZqD4q IdBhEkQA3myBDAWFfgouImKPj/nJfIXEWdyDRbF9NGBwqhRPKU9syf2g3EuwC2XZjN niu9A5/JOJeDyPmqA0S7SmwSrGYHETcmH8OxVqU4= 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.19 227/239] libcxgb: Dont accidentally set RTO_ONLINK in cxgb_find_route() Date: Mon, 24 Jan 2022 19:44:25 +0100 Message-Id: <20220124183950.325346337@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183943.102762895@linuxfoundation.org> References: <20220124183943.102762895@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);