Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3299037ybb; Tue, 31 Mar 2020 02:23:17 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsW8yF3DwcqZWJJtSKE+OnxNoqqfE006jMNgoMX3CTttAFe2TYKtz4O3VQEYPuFLNC6n++X X-Received: by 2002:aca:eac6:: with SMTP id i189mr1362289oih.164.1585646597456; Tue, 31 Mar 2020 02:23:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585646597; cv=none; d=google.com; s=arc-20160816; b=zUC04UxdL998X9O9Gwjs+GSDzQEjitjNcZAfkpqc01lVO+2WtOtCXN5K4amYFIf+Pf 2YVNHbdHoRCkGd4ntFQIZ9eFuqCCymZWTwwNhQ81aTUq9+9SErENm0PHYlmrpbRpB+MF MDh3wuIEXrml2548sZI6pgvIdrCYFlauopVvwjv/roAUEZEsD06yLU7R4Zp+OAlXpwkj a42UVtabFENTRXNqk/SbanEwdXI9p11fAMxVeJAk+h06T+Cmsiea8FqCiOi+5wZIjc7d 5HU7NZjgnHcJEy6GWl2cOIKxn+zu0fMNOn3noN/6M2cIGsp7UqTGzo3RViCXCXccDgYv Vg+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NEnSw6ZaDm1mFGASdx50ey3tJFsX7GMBj9p5rqk+MP0=; b=WWae4UoMS54ds2n6R2dlphvHj6ClpsbjBFLvAP+NF9AxlXeRRcORvLe6PxG/5JmKwk lWIzUifBx/9QOd33TR+KESbWKkabi2xl/mALZHr+0/Z03bdXdmL1bZA6rxJVPmrNBTS1 o/8HXPbgNgl3ViDs4mVf6/X88aymYtE0qjJuXac7PNt2pmJ4HaxKCafjFer/jiVBT1oB dgsJaXFfjI2jmaP4B+DoscrSPcQisW629kqJP0vop1bndnljexvlwmfIEUtq9rRV7ulf Oidd6TcH7LoLYx8PywZU7SA30EkA91c3mDhZGA2rK0HmEjgVlbsmYV3zpryJLYddlseK xyZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rWerTadg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h1si7188983otr.127.2020.03.31.02.23.05; Tue, 31 Mar 2020 02:23:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rWerTadg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731272AbgCaJHt (ORCPT + 99 others); Tue, 31 Mar 2020 05:07:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:49744 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731175AbgCaJHs (ORCPT ); Tue, 31 Mar 2020 05:07:48 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2B5D7208E0; Tue, 31 Mar 2020 09:07:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645667; bh=md3ySTDtGCsK9lPvdz028XzOJvftd8AboUOMc0WB+Ug=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rWerTadgxieCrVlTDkANXXs2it5mHygfBnhTPc8Oh5oZbK6r/QfXHfhxtTX/9fOuK gyF68qv5CS3rPszqd4WozsqkF4gpLA4Vt/KupOaQFAGlPL3cPWVE2gRx5sY42yvS5X 9SkwPSQJBY8i1frs5iwtlwWuHQzmRU4OgmWoS/Gk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maor Gottlieb , Leon Romanovsky , Jason Gunthorpe Subject: [PATCH 5.5 126/170] RDMA/mlx5: Block delay drop to unprivileged users Date: Tue, 31 Mar 2020 10:59:00 +0200 Message-Id: <20200331085437.253703462@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maor Gottlieb commit ba80013fba656b9830ef45cd40a6a1e44707f47a upstream. It has been discovered that this feature can globally block the RX port, so it should be allowed for highly privileged users only. Fixes: 03404e8ae652("IB/mlx5: Add support to dropless RQ") Link: https://lore.kernel.org/r/20200322124906.1173790-1-leon@kernel.org Signed-off-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/mlx5/qp.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c @@ -6158,6 +6158,10 @@ struct ib_wq *mlx5_ib_create_wq(struct i if (udata->outlen && udata->outlen < min_resp_len) return ERR_PTR(-EINVAL); + if (!capable(CAP_SYS_RAWIO) && + init_attr->create_flags & IB_WQ_FLAGS_DELAY_DROP) + return ERR_PTR(-EPERM); + dev = to_mdev(pd->device); switch (init_attr->wq_type) { case IB_WQT_RQ: