|
@@ -1399,6 +1399,9 @@ ssize_t ib_uverbs_create_qp(struct ib_uverbs_file *file,
|
|
if (copy_from_user(&cmd, buf, sizeof cmd))
|
|
if (copy_from_user(&cmd, buf, sizeof cmd))
|
|
return -EFAULT;
|
|
return -EFAULT;
|
|
|
|
|
|
|
|
+ if (cmd.qp_type == IB_QPT_RAW_PACKET && !capable(CAP_NET_RAW))
|
|
|
|
+ return -EPERM;
|
|
|
|
+
|
|
INIT_UDATA(&udata, buf + sizeof cmd,
|
|
INIT_UDATA(&udata, buf + sizeof cmd,
|
|
(unsigned long) cmd.response + sizeof resp,
|
|
(unsigned long) cmd.response + sizeof resp,
|
|
in_len - sizeof cmd, out_len - sizeof resp);
|
|
in_len - sizeof cmd, out_len - sizeof resp);
|