Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3595485pxb; Mon, 24 Jan 2022 13:06:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWeOiGaj4EEo4ehx91913TlS49FTT62O53Lu7lODBlinKu/ACEV4boGinOmG9Fd/dGpn1V X-Received: by 2002:a17:90a:cb0d:: with SMTP id z13mr184433pjt.192.1643058398640; Mon, 24 Jan 2022 13:06:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643058398; cv=none; d=google.com; s=arc-20160816; b=qVd85qwVOVpx9jGQdIdCqu4AWbBUgiPH06G7zGpckuOAmM1xhdYe+56n6x3wASYiId lZ8O0LuCQkkeKboQIv1EMw4C9PWyD/9S2HTlisvczRz9KYmwxqB10GrPZ3r8J5Gn0Msr 9C7lZ8HGX8RJ4sE3W3w/p1CqMzmyof7xYZh0OCp6gbduTpWAzehwYlDKnS5Dkotv7tVv 1TfIakKh9gwlc1k7U1J7LQI9Yw9sFI/9eP2lzl9K+WTXrkyiLXLjtEK2I00GpQ2GfnW8 F9QF4IybHhXxYrbwFJJ4VFQXBVo9qH7lXU0ikW6RytTXI9y+vT9FjPSOY4INrGGgHJHz +8/g== 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=hTDJPr3FZiZPo9h4p2xQa8hHwb/k1ghnxXmrvjk81dESsH313KBzXIQUPgkDssmZ5n 5aW1oZMa5YtPBqdlBNpkAIRlpVgTNNE+UX2A9aB1173tOgQ2pPMkP7aGJ9CTOXVV1Wiq FZbbRy5K9msEGUMXSc9MmqcJaBo3MMkn5t1Cn7CjGvqvxg/JtD9WPpUjJv0CrxdyJomj iWg32ADHtNVfhp3BsbuCsJfjjgJILERU3Jg43T312q18FpaSbS16fR2Ne0NZekTA7Wsd TXsbqxlLrO19S9lMVYQrs5XkFNtfg0BqbhQoi4UGVWrOpWviZIgR3tvXvZa+eAdzc2xa 5+AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cwauFz9r; 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 a1si2651837plp.572.2022.01.24.13.06.21; Mon, 24 Jan 2022 13:06:38 -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=cwauFz9r; 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 S1384552AbiAXUaB (ORCPT + 99 others); Mon, 24 Jan 2022 15:30:01 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:51672 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378786AbiAXUJv (ORCPT ); Mon, 24 Jan 2022 15:09:51 -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 7BF92B810BD; Mon, 24 Jan 2022 20:09:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA2F0C340E7; Mon, 24 Jan 2022 20:09:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643054987; bh=DthYjh+AUf6U0msGHmNsk3EuOaLtsWRn1QyFhfakDLQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cwauFz9rodWObEhGxdAnr1AaScRiVMLoDuxybAfB14o2u8W+zf1RFgj4DxCL2ulCZ o4Txi9bdxReLRG2RshtPL6rfY+LsLg05AuBqMluJ6adjgjvzuINbc8gt0ElulIrAWs Ra0pmOP5q3p7nbBCq3GGCvNAAh7FBm+oS+OwoN9A= 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.10 538/563] libcxgb: Dont accidentally set RTO_ONLINK in cxgb_find_route() Date: Mon, 24 Jan 2022 19:45:03 +0100 Message-Id: <20220124184043.042063436@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184024.407936072@linuxfoundation.org> References: <20220124184024.407936072@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);