summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2005-10-14 14:00:58 -0700
committerRoland Dreier <rolandd@cisco.com>2005-10-17 15:20:30 -0700
commit883a99c7024c5763d6d4f22d9239c133893e8d74 (patch)
tree659a7982a51d0ba187dac826a5b1e5ef319692fd /drivers/infiniband/core
parent56c202d6e4f542468fe79b8a735cf128898b87fb (diff)
downloadop-kernel-dev-883a99c7024c5763d6d4f22d9239c133893e8d74.zip
op-kernel-dev-883a99c7024c5763d6d4f22d9239c133893e8d74.tar.gz
[IB] uverbs: Add a mask of device methods allowed for userspace
Give each device a uverbs_cmd_mask, so that a low-level driver can control which methods may be called on behalf of userspace. Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/core')
-rw-r--r--drivers/infiniband/core/uverbs_main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index 3a88700..6a5e508 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -514,7 +514,8 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf,
if (hdr.command < 0 ||
hdr.command >= ARRAY_SIZE(uverbs_cmd_table) ||
- !uverbs_cmd_table[hdr.command])
+ !uverbs_cmd_table[hdr.command] ||
+ !(file->device->ib_dev->uverbs_cmd_mask & (1ull << hdr.command)))
return -EINVAL;
if (!file->ucontext &&
OpenPOWER on IntegriCloud