Michael S. Tsirkin wrote:
Sean, what's up with patch numbering?

The second patch labeled 1/3 is really 2/3. I resent 2/3 with the correct subject heading.

+static ssize_t ucma_set_option(struct ucma_file *file, const char __user 
*inbuf,
+                              int in_len, int out_len)
+{
+       struct rdma_ucm_set_option cmd;
+       struct ucma_context *ctx;
+       int ret;
+
+       if (copy_from_user(&cmd, inbuf, sizeof(cmd)))
+               return -EFAULT;
+
+       ctx = ucma_get_ctx(file, cmd.id);
+       if (IS_ERR(ctx))
+               return PTR_ERR(ctx);
+
+       ret = rdma_set_option(ctx->cm_id, cmd.level, cmd.optname,
+                             (void *) (unsigned long) cmd.optval,
+                             cmd.optlen);


Casting a value from userspace to void * looks iffy.

This should be a userspace pointer. The kernel setsockopt interface takes a char * for the option value. Maybe this would be better?

- Sean
_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to