Christoph> The check should be in ib_uverbs_reg_mr(), not in every driver.
Agreed -- I did it like this:
--- infiniband/core/uverbs_cmd.c (revision 3613)
+++ infiniband/core/uverbs_cmd.c (working copy)
@@ -396,6 +396,14 @@ ssize_t ib_uverbs_reg_mr(struct ib_uverb
if ((cmd.start & ~PAGE_MASK) != (cmd.hca_va & ~PAGE_MASK))
return -EINVAL;
+ /*
+ * Local write permission is required if remote write or
+ * remote atomic permission is also requested.
+ */
+ if (cmd.access_flags & (IB_ACCESS_REMOTE_ATOMIC |
IB_ACCESS_REMOTE_WRITE) &&
+ !(cmd.access_flags & IB_ACCESS_LOCAL_WRITE))
+ return -EINVAL;
+
obj = kmalloc(sizeof *obj, GFP_KERNEL);
if (!obj)
return -ENOMEM;
_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general
To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general