projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
39ce85f
)
RDMA/rxe: Verify modify_device mask
author
Kamal Heib
<kamalheib1@gmail.com>
Mon, 23 Sep 2019 10:41:58 +0000
(13:41 +0300)
committer
Jason Gunthorpe
<jgg@mellanox.com>
Tue, 1 Oct 2019 16:06:10 +0000
(13:06 -0300)
Verify that the passed mask to rxe_modify_device() is supported.
Link:
https://lore.kernel.org/r/20190923104158.5331-4-kamalheib1@gmail.com
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/sw/rxe/rxe_verbs.c
patch
|
blob
|
history
diff --git
a/drivers/infiniband/sw/rxe/rxe_verbs.c
b/drivers/infiniband/sw/rxe/rxe_verbs.c
index
623129f
..
fa47bdc
100644
(file)
--- a/
drivers/infiniband/sw/rxe/rxe_verbs.c
+++ b/
drivers/infiniband/sw/rxe/rxe_verbs.c
@@
-106,6
+106,10
@@
static int rxe_modify_device(struct ib_device *dev,
{
struct rxe_dev *rxe = to_rdev(dev);
+ if (mask & ~(IB_DEVICE_MODIFY_SYS_IMAGE_GUID |
+ IB_DEVICE_MODIFY_NODE_DESC))
+ return -EOPNOTSUPP;
+
if (mask & IB_DEVICE_MODIFY_SYS_IMAGE_GUID)
rxe->attr.sys_image_guid = cpu_to_be64(attr->sys_image_guid);