diff options
author | Kamal Heib <kamalheib1@gmail.com> | 2019-09-23 13:41:58 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2019-10-01 13:06:10 -0300 |
commit | f3fceba5da5e149ecd8e58c1e1c60464629de27b (patch) | |
tree | 174172a3479c6946e888c33aa58bd9ae1de51a50 | |
parent | 39ce85f3b18597b17a3db74906db2c6360d66c16 (diff) | |
download | lwn-f3fceba5da5e149ecd8e58c1e1c60464629de27b.tar.gz lwn-f3fceba5da5e149ecd8e58c1e1c60464629de27b.zip |
RDMA/rxe: Verify modify_device mask
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>
-rw-r--r-- | drivers/infiniband/sw/rxe/rxe_verbs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c index 623129f27f5a..fa47bdcc7f54 100644 --- 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); |