diff options
| author | Maor Gottlieb <maorg@mellanox.com> | 2020-03-22 14:49:06 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-04-02 15:28:18 +0200 |
| commit | 2eb46d0044849a70c796e3646a6ce50e5a69a992 (patch) | |
| tree | f559737b083f9c5034227ee75d9fb74475d4e32d /drivers/infiniband/hw | |
| parent | f8ee708284e1d62ecc345908b40b7f9ccca4e603 (diff) | |
| download | linux-2eb46d0044849a70c796e3646a6ce50e5a69a992.tar.gz linux-2eb46d0044849a70c796e3646a6ce50e5a69a992.tar.bz2 linux-2eb46d0044849a70c796e3646a6ce50e5a69a992.zip | |
RDMA/mlx5: Block delay drop to unprivileged users
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 <maorg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/infiniband/hw')
| -rw-r--r-- | drivers/infiniband/hw/mlx5/qp.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c index 4c0f0ce02d2f..4fc9278d0dde 100644 --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c @@ -5524,6 +5524,10 @@ struct ib_wq *mlx5_ib_create_wq(struct ib_pd *pd, 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: |
