Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5308543pxv; Wed, 21 Jul 2021 02:17:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVH4f2idEI2oJh7uyCsDNxynwGlXI1CIPAGYrRv/9kLXNdajiY7/S+4rBQn/ZYSlZUnSRd X-Received: by 2002:a05:6638:1915:: with SMTP id p21mr29892946jal.104.1626859026731; Wed, 21 Jul 2021 02:17:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626859026; cv=none; d=google.com; s=arc-20160816; b=JL/dyj7BnPLEVakLa0oYo7wcevJeEfodPLc0l3VU9iXWb6OCTcIbODs943+zeQ5gya RDrxr3X/fLes68mdA6235Hxmy6sbPugFdAVat1oH4TguW14BF6fLrVsJ20F1ZU758WKt SonD3iGen1y6Me3rOAO4rATcHZP0qqT6vbtTmELdrgik26ST6bYCb2WeCTezKgrcT6Qz IL9s4r1B+ZfgeW8DuYiWxrwC+Cn11Ygw1GBJWP7/gD7sIkBxt3B/gGuYXGewLwCabqCj mjB0Bwg2aRb5Vj8XhK2Pg97+GwWlueqwg8igK60ZS3asriq4cR4FBk9kxuoZQ4j7iJis OhLA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fkJ5RBd9IpK0oCMJF5rwrjCq5DF76Cl1CmISDnhuaHA=; b=q9GavX84EdeuJNQWn+s63MU4qJN/yv1Jd2ohQj6wLElQOJyT5PdZd7S7jUYMmS3NDO sVi6wRbElIOyqZXVTBH+05QD+4Y2alrHcb3eE6hmkWMhmipsixr91osT52BcyXxljxoz V/BIQJJjRvu/SjBntqk4g/O++dg2a+4l2tE6QiHkeVGr4IRlXneua479/6k7lXDHas0t fgE4RsBz11DAWYaA93VG7Jw5MgiAJE6FZKLOoUo/oe2sINYT/25wwbEHhQU3193FYp/V KFSPtrLTdjNH3NsXrfYCy0x00ISBUc2GcfeOSSIlVZnizZyimCFpNVF88Ob25+N7wLXH lmSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LOr+h7hz; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u5si30185841jad.124.2021.07.21.02.16.55; Wed, 21 Jul 2021 02:17:06 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=LOr+h7hz; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237292AbhGUIdy (ORCPT + 99 others); Wed, 21 Jul 2021 04:33:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:56360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236235AbhGUI0r (ORCPT ); Wed, 21 Jul 2021 04:26:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 15D7C60FE9; Wed, 21 Jul 2021 09:07:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626858444; bh=tbn33wjjVuiv3kzeE4HsxsCHrdDaV9aipcwfnmjZej8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LOr+h7hzgUvO5OSjbzse7dwqjjdsOmgqknQ509BDgZMwB8wZGKUbeN/2WTMneqYuE Bek655opyXn95IPmu0tNvQWVlgUmI49435M4HPrOBsVdWvkVLdTGMAoPybFPk42IIa TYmh1FZnVfn0i9+kf3l4Q4mp0NcxdVnZkAIz6+gNBfKrNYhaTxoW904qWxG8bjhhRa EzLEddSubnA/5ydhLJiXNRTtqAqzb44IlkT4ZFVZITuh42hoggP5SfmnWe+A49/O1w WtxWvJKPOzMZRZR8G50PV2vrwArW33/KlRseMsZvhpjBkcpQ4G9yE2MTTU1xl2lVr1 yiwj3mgG7eg2w== From: Leon Romanovsky To: Doug Ledford , Jason Gunthorpe Cc: Leon Romanovsky , linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Mark Zhang , Christoph Hellwig Subject: [PATCH rdma-next v1 3/7] RDMA/core: Remove protection from wrong in-kernel API usage Date: Wed, 21 Jul 2021 12:07:06 +0300 Message-Id: <82dc7840fa802a17bf80a2f9a07c1433b204269c.1626857976.git.leonro@nvidia.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Leon Romanovsky The ib_create_named_qp() is kernel verb that is not used for user supplied attributes. In such case, it is ULP responsibility to provide valid QP attributes. In-kernel API shouldn't check it, exactly like other functions that don't check device capabilities. Signed-off-by: Leon Romanovsky --- drivers/infiniband/core/verbs.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index 635642a3ecbc..2090f3c9f689 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -1219,16 +1219,6 @@ struct ib_qp *ib_create_named_qp(struct ib_pd *pd, struct ib_qp *qp; int ret; - if (qp_init_attr->rwq_ind_tbl && - (qp_init_attr->recv_cq || - qp_init_attr->srq || qp_init_attr->cap.max_recv_wr || - qp_init_attr->cap.max_recv_sge)) - return ERR_PTR(-EINVAL); - - if ((qp_init_attr->create_flags & IB_QP_CREATE_INTEGRITY_EN) && - !(device->attrs.device_cap_flags & IB_DEVICE_INTEGRITY_HANDOVER)) - return ERR_PTR(-EINVAL); - /* * If the callers is using the RDMA API calculate the resources * needed for the RDMA READ/WRITE operations. -- 2.31.1