Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3618473pxb; Mon, 24 Jan 2022 13:38:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+14GJYfJn3DBT5cj6r35vrkof//rVSpWX24PDhzUnmzleDt0G0vphvYjqZNpoNfXIxM2X X-Received: by 2002:a17:902:b08b:b0:149:88bb:b477 with SMTP id p11-20020a170902b08b00b0014988bbb477mr16454275plr.137.1643060314939; Mon, 24 Jan 2022 13:38:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643060314; cv=none; d=google.com; s=arc-20160816; b=mYIPsZeRErWRu1n1LEzL2+NOLCZUS2AYEGkjjPZe40ZnqIrW3HgpB47MK2y/WDrQSA BpIV0WqBpYXSqHKMxysgkiESjrcJ1wXzwH+oJ1XFSza1liKk7t7pNSlUFwTOH1VO2W7y 2DEGQD7AkCK2BlIMLd0fGauXAx2CRuO2ZCwprqJJo9Fu4mJxAjfS8hJz2gkBEpvKbMXM i+kffCIZVbEUbwfRafGoyvTuQiPyhAD53nQmhUj4sVxY5oFBOLwFwvEngHDrGF+7QPJv mhXanVRLPHDmgqegj6WywGQn8z+Natijmffq14SimpxJneWTaO27lnfqb0PXVsoOT+qJ l0Sg== 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=A+NL9heTQ6ZvTe3+/Pp50nOq1M80rA1+rT6IgOsLFRhU5RjswWxrYdHBAN+dIuivKE k2VT1n42MxEibJn/mhRpj17dlicOjWYgh2esZpUbutXvvLTVcsoPv6kjeGIMlJ3G33t+ m61V0QB5cp9uGhc844L1b7Oqhw7qCq7+QAG1Ein5f7rydSFtgFc2KkAplsIW+peHlnIn hb1OBx16YEt+CFq36mHQjjx7mEimFpbeLblzWrKY9KFYofhCjZ5fgdwBdbOYlLmC7oNZ v+5F4KC93jymXD/3hwDnHzMCgQf4dIwCIVH0XxTnI1l96ma/rJ6oHjKZ/bzIY/YmcDQ8 ZCRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qqqBd78s; 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 18si478535pjg.78.2022.01.24.13.38.22; Mon, 24 Jan 2022 13:38:34 -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=qqqBd78s; 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 S1376650AbiAXVSv (ORCPT + 99 others); Mon, 24 Jan 2022 16:18:51 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:49066 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1392216AbiAXUuo (ORCPT ); Mon, 24 Jan 2022 15:50:44 -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 B6A7CB80FA1; Mon, 24 Jan 2022 20:50:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3B1DC340E5; Mon, 24 Jan 2022 20:50:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643057440; bh=DthYjh+AUf6U0msGHmNsk3EuOaLtsWRn1QyFhfakDLQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qqqBd78sVRldpQK0tCHLCAVupfWLsdgUxJFT4kU3+/jAzCD61O6rOHjKkmyPwSX/x r0rv1zPS+SmIMXU6QXxvWoXMk/qRL0q1zFBbzvOSf2f4n0Di0aeldcIvnCi0noScpu ujzwV12d1PFH432vDT/Rx1RJCud6/nEMu8Ilz5fk= 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 813/846] libcxgb: Dont accidentally set RTO_ONLINK in cxgb_find_route() Date: Mon, 24 Jan 2022 19:45:30 +0100 Message-Id: <20220124184128.961530722@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 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);