projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a112341
)
RDMA/uverbs: Verify MR access flags
author
Michael Guralnik
<michaelgur@mellanox.com>
Wed, 8 Jan 2020 18:05:35 +0000
(20:05 +0200)
committer
Jason Gunthorpe
<jgg@mellanox.com>
Thu, 16 Jan 2020 19:55:45 +0000
(15:55 -0400)
Verify that MR access flags that are passed from user are all supported
ones, otherwise an error is returned.
Fixes:
4fca03778351
("IB/uverbs: Move ib_access_flags and ib_read_counters_flags to uapi")
Link:
https://lore.kernel.org/r/1578506740-22188-6-git-send-email-yishaih@mellanox.com
Signed-off-by: Michael Guralnik <michaelgur@mellanox.com>
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
include/rdma/ib_verbs.h
patch
|
blob
|
history
diff --git
a/include/rdma/ib_verbs.h
b/include/rdma/ib_verbs.h
index
d8031f6
..
b20b89e
100644
(file)
--- a/
include/rdma/ib_verbs.h
+++ b/
include/rdma/ib_verbs.h
@@
-4310,6
+4310,9
@@
static inline int ib_check_mr_access(int flags)
!(flags & IB_ACCESS_LOCAL_WRITE))
return -EINVAL;
+ if (flags & ~IB_ACCESS_SUPPORTED)
+ return -EINVAL;
+
return 0;
}