提交 76339658 编写于 作者: M Maor Gottlieb 提交者: Yang Yingliang

RDMA/mlx5: Block delay drop to unprivileged users

commit ba80013f 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: 03404e8a("IB/mlx5: Add support to dropless RQ")
Link: https://lore.kernel.org/r/20200322124906.1173790-1-leon@kernel.orgSigned-off-by: NMaor Gottlieb <maorg@mellanox.com>
Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 7e493485
...@@ -5524,6 +5524,10 @@ struct ib_wq *mlx5_ib_create_wq(struct ib_pd *pd, ...@@ -5524,6 +5524,10 @@ struct ib_wq *mlx5_ib_create_wq(struct ib_pd *pd,
if (udata->outlen && udata->outlen < min_resp_len) if (udata->outlen && udata->outlen < min_resp_len)
return ERR_PTR(-EINVAL); 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); dev = to_mdev(pd->device);
switch (init_attr->wq_type) { switch (init_attr->wq_type) {
case IB_WQT_RQ: case IB_WQT_RQ:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册