summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorLeon Romanovsky <leonro@mellanox.com>2018-12-24 11:05:16 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-22 21:40:34 +0100
commit836edf22ffd1bd3616683c00677f94e881fa2a20 (patch)
tree89932155e27eb0b9dcbaa9420b6fdc4ddaa82784 /drivers/infiniband
parent8f4a0e7d8befe681050465d91ad89250d10b57ec (diff)
downloadlinux-stable-836edf22ffd1bd3616683c00677f94e881fa2a20.tar.gz
linux-stable-836edf22ffd1bd3616683c00677f94e881fa2a20.tar.bz2
linux-stable-836edf22ffd1bd3616683c00677f94e881fa2a20.zip
RDMA/nldev: Don't expose unsafe global rkey to regular user
commit a9666c1cae8dbcd1a9aacd08a778bf2a28eea300 upstream. Unsafe global rkey is considered dangerous because it exposes memory registered for all memory in the system. Only users with a QP on the same PD can use the rkey, and generally those QPs will already know the value. However, out of caution, do not expose the value to unprivleged users on the local system. Require CAP_NET_ADMIN instead. Cc: <stable@vger.kernel.org> # 4.16 Fixes: 29cf1351d450 ("RDMA/nldev: provide detailed PD information") 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')
-rw-r--r--drivers/infiniband/core/nldev.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c
index 0385ab438320..f6fa9b115fda 100644
--- a/drivers/infiniband/core/nldev.c
+++ b/drivers/infiniband/core/nldev.c
@@ -579,10 +579,6 @@ static int fill_res_pd_entry(struct sk_buff *msg, struct netlink_callback *cb,
if (nla_put_u64_64bit(msg, RDMA_NLDEV_ATTR_RES_USECNT,
atomic_read(&pd->usecnt), RDMA_NLDEV_ATTR_PAD))
goto err;
- if ((pd->flags & IB_PD_UNSAFE_GLOBAL_RKEY) &&
- nla_put_u32(msg, RDMA_NLDEV_ATTR_RES_UNSAFE_GLOBAL_RKEY,
- pd->unsafe_global_rkey))
- goto err;
if (fill_res_name_pid(msg, res))
goto err;