git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
[IB] uverbs: Add a mask of device methods allowed for userspace
[safe/jmp/linux-2.6]
/
drivers
/
infiniband
/
core
/
uverbs_main.c
diff --git
a/drivers/infiniband/core/uverbs_main.c
b/drivers/infiniband/core/uverbs_main.c
index
3a88700
..
6a5e508
100644
(file)
--- 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 &&