Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2887360rwb; Mon, 15 Aug 2022 13:20:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR5IUJW/rgLcolatP3OQR+ru/ThPqKyCfhWi60KJIH/VEiEfnXFB0Y1/RTFNWzA5K/UNPG9z X-Received: by 2002:a17:907:3ea5:b0:730:8b95:dc69 with SMTP id hs37-20020a1709073ea500b007308b95dc69mr11435007ejc.34.1660594820180; Mon, 15 Aug 2022 13:20:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594820; cv=none; d=google.com; s=arc-20160816; b=RONeHgpIWL47uEwB0jADBjR7LkJ/cHE5374V3uHtoUkBgqhd1CURsBfR0G4Lfsfmna Wn9UHjOqQRaOzTFW+WiAqJxJa5safekOO8r6Vvm2Ga8RpCChzRTjWVnizD4RiMjh2kgx T07iNmHk5pHlywQo75ELZ3paz6o3aDoBzd+TQFMqQs2m/yDGdtpAXUNwNNnATJXX/m2g lTdHvLgGxGZdXtW6Gqb9+YqJJLU/kAzjselSRAh5Q0KpAh/OfltLaIUB/fxNaNRzzxdi CumyOHwooKBJE5l/kjW0j1BAHJBwxG8qs7PqMBdVAXvPzw3lXaxOtk7OxFhkXcXed2wW N9RA== 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=hWQoxPYtZG0Ef+zfhcwgqMRCICcR9uwWTdWjJOFTg2s=; b=lJ8jevuygQWaInYtSk1fXjFPTUai3dQB87dyhjwg4pEoH/t/je3nYaJctEhaSG4Keq iMs0XsWfhQqU3fuvnmKa5Hn8H2wFZ+F6oo8r37MQrdn6cCs9Ljuhd7cowxIQUPS77v9X langtfiNxiA3PQi3/8wBBs2hWNZ21OLer9014/3FSU8AnkGLpX8dwIId5R62TZosrOuZ ErsN3qXEt5GoubqJt0DDvYw1QzW84DhbtR2ROPqpjZsOit/MoMZB2+xSR3kKwfrJ1KgA +HVANVgNEHLcrEmSzLMqpzf1yrNZwUTb5meVXz1mhuK39yoa9fXYmFUPll/lKBAvoMwe BTsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VtNbrUYg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h9-20020a05640250c900b0043e33c1d5eesi9460101edb.230.2022.08.15.13.19.53; Mon, 15 Aug 2022 13:20:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VtNbrUYg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S245262AbiHOTYs (ORCPT + 99 others); Mon, 15 Aug 2022 15:24:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245158AbiHOTWn (ORCPT ); Mon, 15 Aug 2022 15:22:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B6615A179; Mon, 15 Aug 2022 11:40:41 -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 ams.source.kernel.org (Postfix) with ESMTPS id E0345B81081; Mon, 15 Aug 2022 18:40:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2DB27C433D6; Mon, 15 Aug 2022 18:40:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660588838; bh=UmW1dDwj+2KZmvTxLZOreHEXMcT3SnZWcsvpmVelZBw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VtNbrUYg7ZhZW4DUUoZGn9bH+3cGyFtBpSMtnrlEk1RQJs4ecUmX4wPObelb6DQYK l3xZvWppRE4l20Tk5Q/myXcdOi2Evshnuvi+mxAn5aqhY7Obc3eyZ4Y5JjUAf43yrm 5Zv+n5wXD4M6ni2ANO8tiYIlOC0OyhDq9aTPBGWc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bob Pearson , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.15 523/779] RDMA/rxe: Fix mw bind to allow any consumer key portion Date: Mon, 15 Aug 2022 20:02:47 +0200 Message-Id: <20220815180359.612340190@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bob Pearson [ Upstream commit 1603f89935ec86d40a7667e1250392626976ccc2 ] The current implementation of rxe_check_bind_mw() in rxe_mw.c is incorrect since it requires the new key portion provided by the mw consumer to be different than the previous key portion. This is not required by the IBA. Remove the test. Link: https://lore.kernel.org/linux-rdma/fb4614e7-4cac-0dc7-3ef7-766dfd10e8f2@gmail.com/ Fixes: 32a577b4c3a9 ("Add support for bind MW work requests") Link: https://lore.kernel.org/r/20220714204619.13396-1-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/sw/rxe/rxe_mw.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe_mw.c b/drivers/infiniband/sw/rxe/rxe_mw.c index a5e2ea7d80f0..933a0b29275b 100644 --- a/drivers/infiniband/sw/rxe/rxe_mw.c +++ b/drivers/infiniband/sw/rxe/rxe_mw.c @@ -71,8 +71,6 @@ int rxe_dealloc_mw(struct ib_mw *ibmw) static int rxe_check_bind_mw(struct rxe_qp *qp, struct rxe_send_wqe *wqe, struct rxe_mw *mw, struct rxe_mr *mr) { - u32 key = wqe->wr.wr.mw.rkey & 0xff; - if (mw->ibmw.type == IB_MW_TYPE_1) { if (unlikely(mw->state != RXE_MW_STATE_VALID)) { pr_err_once( @@ -110,11 +108,6 @@ static int rxe_check_bind_mw(struct rxe_qp *qp, struct rxe_send_wqe *wqe, } } - if (unlikely(key == (mw->rkey & 0xff))) { - pr_err_once("attempt to bind MW with same key\n"); - return -EINVAL; - } - /* remaining checks only apply to a nonzero MR */ if (!mr) return 0; -- 2.35.1