From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0510BC433FE for ; Thu, 13 Oct 2022 08:43:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229612AbiJMInt (ORCPT ); Thu, 13 Oct 2022 04:43:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229533AbiJMIns (ORCPT ); Thu, 13 Oct 2022 04:43:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD64811C245 for ; Thu, 13 Oct 2022 01:43:47 -0700 (PDT) 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 2EA2D61650 for ; Thu, 13 Oct 2022 08:43:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04ED0C433C1; Thu, 13 Oct 2022 08:43:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665650626; bh=LAuHilzhpRx+30a7otEBFQ0jBplpUeRBy5RH919U7Zs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Lwo0Rii5qQQvEDNWip3jaZS5CRS65qTbST05cdumVlW3KR/Vg+KZEJFhUXn5KhTlr ww+eViZj/YKgBfMVcWewHkEfc5CgEJsyv3cTuhQHKa9vjYk2sdBwtZwPPsfrAeHogz rVJ0uijxLw+SllctVDWC/yQ6XI58wo6St+Ejqyy3C+pWp6KKRYViOQJinFk+ODqgIJ K5rc1QacnqBbDdDieIg0LZ2IUNzf69b2hyRCCMb5N/iVltGKUWR72hzG25zghCaOD2 0RsGI748GwMcblcWvXi4rLhorfOPg4uNIUaPhXatZ2Va7+t2fZmvOim8waQ00rA3jB uB+9x6nShYM/g== Date: Thu, 13 Oct 2022 11:43:42 +0300 From: Leon Romanovsky To: =?iso-8859-1?Q?H=E5kon?= Bugge Cc: Jason Gunthorpe , Michael Guralnik , linux-rdma@vger.kernel.org Subject: Re: [PATCH rdma-rc] RDMA/cma: Use output interface for net_dev check Message-ID: References: <20221012141542.16925-1-haakon.bugge@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221012141542.16925-1-haakon.bugge@oracle.com> Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On Wed, Oct 12, 2022 at 04:15:42PM +0200, Håkon Bugge wrote: > Commit 27cfde795a96 ("RDMA/cma: Fix arguments order in net device > validation") swapped the src and dst addresses in the call to > validate_net_dev(). > > As a consequence, the test in validate_ipv4_net_dev() to see if the > net_dev is the right one, is incorrect for port 1 <-> 2 communication > when the ports are on the same sub-net. This is fixed by denoting the > flowi4_oif as the device instead of the incoming one. > > The bug has not been observed using IPv6 addresses. > > Fixes: 27cfde795a96 ("RDMA/cma: Fix arguments order in net device validation") > Signed-off-by: Håkon Bugge > --- > drivers/infiniband/core/cma.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Thanks, Reviewed-by: Leon Romanovsky