svn commit: r298342 - head/sys/ofed/drivers/infiniband/core
Hans Petter Selasky
hselasky at FreeBSD.org
Wed Apr 20 07:44:52 UTC 2016
Author: hselasky
Date: Wed Apr 20 07:44:50 2016
New Revision: 298342
URL: https://svnweb.freebsd.org/changeset/base/298342
Log:
Fix inverted priv check calls. Priv check returns zero on success and
an error code on failure. Refer to man 9 priv_check .
Sponsored by: Mellanox Technologies
MFC after: 1 week
Modified:
head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c
Modified: head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c
==============================================================================
--- head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c Wed Apr 20 06:29:03 2016 (r298341)
+++ head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c Wed Apr 20 07:44:50 2016 (r298342)
@@ -1613,7 +1613,7 @@ ssize_t ib_uverbs_create_qp(struct ib_uv
response = (void __user *) (unsigned long) cmd->response;
if (!disable_raw_qp_enforcement &&
- cmd->qp_type == IB_QPT_RAW_PACKET && !priv_check(curthread, PRIV_NET_RAW))
+ cmd->qp_type == IB_QPT_RAW_PACKET && priv_check(curthread, PRIV_NET_RAW))
return -EPERM;
INIT_UDATA(&udata, buf + cmd_size, response + resp_size,
@@ -3377,7 +3377,7 @@ int ib_uverbs_ex_create_flow(struct ib_u
if (cmd.comp_mask)
return -EINVAL;
- if (!priv_check(curthread, PRIV_NET_RAW) && !disable_raw_qp_enforcement)
+ if (priv_check(curthread, PRIV_NET_RAW) && !disable_raw_qp_enforcement)
return -EPERM;
if (cmd.flow_attr.num_of_specs > IB_FLOW_SPEC_SUPPORT_LAYERS)
@@ -3686,7 +3686,7 @@ ssize_t ib_uverbs_exp_create_qp(struct i
return ret;
if (!disable_raw_qp_enforcement &&
- cmd_exp.qp_type == IB_QPT_RAW_PACKET && !priv_check(curthread,
+ cmd_exp.qp_type == IB_QPT_RAW_PACKET && priv_check(curthread,
PRIV_NET_RAW))
return -EPERM;
More information about the svn-src-head
mailing list