From owner-svn-src-all@freebsd.org Wed Apr 20 07:44:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02F1DB15096; Wed, 20 Apr 2016 07:44:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3A0B1BB2; Wed, 20 Apr 2016 07:44:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3K7iorK043175; Wed, 20 Apr 2016 07:44:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3K7io8X043174; Wed, 20 Apr 2016 07:44:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201604200744.u3K7io8X043174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Apr 2016 07:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298342 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 07:44:52 -0000 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;