From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Morris Subject: Re: [PATCH v7 2/9] IB/core: Enforce PKey security on QPs Date: Mon, 22 May 2017 10:13:16 +1000 (AEST) Message-ID: References: <1495198139-69993-1-git-send-email-danielj@mellanox.com> <1495198139-69993-3-git-send-email-danielj@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <1495198139-69993-3-git-send-email-danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Dan Jurgens Cc: Chris Wright , Paul Moore , Stephen Smalley , Eric Paris , dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, selinux-+05T5uksL2qpZYMLLGbcSA@public.gmane.org, linux-security-module-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, yevgenyp-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org List-Id: linux-rdma@vger.kernel.org On Fri, 19 May 2017, Dan Jurgens wrote: > security/security.c | 385 ++++++++++++++++++++++ This looks wrong -- merge problem? > + if (pps->alt.state != IB_PORT_PKEY_NOT_VALID) { > + get_pkey_and_subnet_prefix(&pps->alt, > + &pkey, > + &subnet_prefix); > + > + ret = enforce_qp_pkey_security(pkey, > + subnet_prefix, > + sec); > + } > + > + if (ret) > + goto out; The above if/goto is unnecessary. > + > +out: > + return ret; > +} -- James Morris -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Mon, 22 May 2017 10:13:16 +1000 (AEST) From: James Morris To: Dan Jurgens cc: Chris Wright , Paul Moore , Stephen Smalley , Eric Paris , dledford@redhat.com, sean.hefty@intel.com, hal.rosenstock@gmail.com, selinux@tycho.nsa.gov, linux-security-module@vger.kernel.org, linux-rdma@vger.kernel.org, yevgenyp@mellanox.com Subject: Re: [PATCH v7 2/9] IB/core: Enforce PKey security on QPs In-Reply-To: <1495198139-69993-3-git-send-email-danielj@mellanox.com> Message-ID: References: <1495198139-69993-1-git-send-email-danielj@mellanox.com> <1495198139-69993-3-git-send-email-danielj@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: On Fri, 19 May 2017, Dan Jurgens wrote: > security/security.c | 385 ++++++++++++++++++++++ This looks wrong -- merge problem? > + if (pps->alt.state != IB_PORT_PKEY_NOT_VALID) { > + get_pkey_and_subnet_prefix(&pps->alt, > + &pkey, > + &subnet_prefix); > + > + ret = enforce_qp_pkey_security(pkey, > + subnet_prefix, > + sec); > + } > + > + if (ret) > + goto out; The above if/goto is unnecessary. > + > +out: > + return ret; > +} -- James Morris From mboxrd@z Thu Jan 1 00:00:00 1970 From: jmorris@namei.org (James Morris) Date: Mon, 22 May 2017 10:13:16 +1000 (AEST) Subject: [PATCH v7 2/9] IB/core: Enforce PKey security on QPs In-Reply-To: <1495198139-69993-3-git-send-email-danielj@mellanox.com> References: <1495198139-69993-1-git-send-email-danielj@mellanox.com> <1495198139-69993-3-git-send-email-danielj@mellanox.com> Message-ID: To: linux-security-module@vger.kernel.org List-Id: linux-security-module.vger.kernel.org On Fri, 19 May 2017, Dan Jurgens wrote: > security/security.c | 385 ++++++++++++++++++++++ This looks wrong -- merge problem? > + if (pps->alt.state != IB_PORT_PKEY_NOT_VALID) { > + get_pkey_and_subnet_prefix(&pps->alt, > + &pkey, > + &subnet_prefix); > + > + ret = enforce_qp_pkey_security(pkey, > + subnet_prefix, > + sec); > + } > + > + if (ret) > + goto out; The above if/goto is unnecessary. > + > +out: > + return ret; > +} -- James Morris -- To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html