Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3577096pxb; Mon, 24 Jan 2022 12:38:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJg7m0bpSamyAF6AvAzpdeDdQHIaKPGmx/BsqUe++XpHFYtayArWyTAF+yqNWYNxJDy6Kl X-Received: by 2002:a17:90b:2248:: with SMTP id hk8mr45321pjb.242.1643056712950; Mon, 24 Jan 2022 12:38:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643056712; cv=none; d=google.com; s=arc-20160816; b=kYV3IRuoJ2O1xU2in3RTgt1cjPfIY6stGZKdNghQHJgCr/haE51bf8cupj5SuT44RK k2W/JKgQhWHD5MEZk/JOj9x4hizyNp3AVK046l2aTyve86tMczp8YZiicq6xaGRx0FIm Ke9A3rXeFbO+/JXS8rYyd9HNQPolMNfB1cwj0wgr6nmrodA6w2MlS8HQd0IvhE/q7ViG Cnlj1ITBV5Wbjpq5u5r9z3J4mN6uM+9jLeE2KYUr9x2DrgzKaQ+urkgaGLygXCrerUpQ 6iRSzC4ZERFt6Nyb+xjgWABf6txLzO3dey2Lkm6ZhwcbWorH1fZXOqscER6ehdk9+hH+ 2HHg== 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=QdNBldSiMtNrmZxmEzdOSxvyehIIEtpfAiBq5IPcixWsMslw6OQ6CBP42egnS4ie/M YB2HBfgvSikDfRiXOafwp5rWajSEFGxRm3iF/eRg9phwTRt+huGD5wr0g6glPRj+KEk9 5E8cJ9i5gwwp8BotiTBOhCkcJxVhTzK/DM3ungbjCqdcOlYjEMekIDMrbj0i8DktGm9e msncCbNiBjZcrPhETKkvmZwK4+wIaHWadpVpeG+PJnY5C2mGld3IVvppZys86TTpx+J5 SkJgEl3EqOhNXyboaxrGxIqn18CF03PZnL6wPBA+7EBFZmcr6en8clQjxMVnvVwcgpqX dWSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CjbyhamF; 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 x69si6604377pgd.654.2022.01.24.12.38.13; Mon, 24 Jan 2022 12:38:32 -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=CjbyhamF; 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 S1357483AbiAXTuI (ORCPT + 99 others); Mon, 24 Jan 2022 14:50:08 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:35146 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354991AbiAXTjr (ORCPT ); Mon, 24 Jan 2022 14:39:47 -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 348696148B; Mon, 24 Jan 2022 19:39:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16BD5C340E5; Mon, 24 Jan 2022 19:39:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643053186; bh=DthYjh+AUf6U0msGHmNsk3EuOaLtsWRn1QyFhfakDLQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CjbyhamFZQ8AOKXP5vuEvNCnumpkhL5R3UJYrdHdmRAHMCfUaIUc3seyhGbBq2+pe BZYlKiVacN2sf34PKmRFWo6h0CwKG2SBJMIjHb/BL7cFXZ7KjFn9ml4B2i/ClRn00O ymDAxuTQvFnPrkN1mZGsUNtwLEmuVyEb0QUSyjoM= 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.4 303/320] libcxgb: Dont accidentally set RTO_ONLINK in cxgb_find_route() Date: Mon, 24 Jan 2022 19:44:47 +0100 Message-Id: <20220124184004.256686805@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183953.750177707@linuxfoundation.org> References: <20220124183953.750177707@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);