From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Johansen Subject: Re: [PATCH security-next v3 07/29] LSM: Convert security_initcall() into DEFINE_LSM() Date: Mon, 1 Oct 2018 14:12:17 -0700 Message-ID: References: <20180925001832.18322-1-keescook@chromium.org> <20180925001832.18322-8-keescook@chromium.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20180925001832.18322-8-keescook@chromium.org> Content-Language: en-GB Sender: linux-kernel-owner@vger.kernel.org To: Kees Cook , James Morris Cc: "Serge E. Hallyn" , Paul Moore , Stephen Smalley , Casey Schaufler , Tetsuo Handa , Mimi Zohar , linux-security-module@vger.kernel.org, selinux@tycho.nsa.gov, "Schaufler, Casey" , Jonathan Corbet , linux-doc@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org List-Id: linux-arch.vger.kernel.org On 09/24/2018 05:18 PM, Kees Cook wrote: > Instead of using argument-based initializers, switch to defining the > contents of struct lsm_info on a per-LSM basis. This also drops > the final use of the now inaccurate "initcall" naming. > > Cc: John Johansen > Cc: James Morris > Cc: "Serge E. Hallyn" > Cc: Paul Moore > Cc: Stephen Smalley > Cc: Casey Schaufler > Cc: Tetsuo Handa > Cc: Mimi Zohar > Cc: linux-security-module@vger.kernel.org > Cc: selinux@tycho.nsa.gov > Signed-off-by: Kees Cook > --- > include/linux/lsm_hooks.h | 6 ++++-- > security/apparmor/lsm.c | 4 +++- > security/integrity/iint.c | 4 +++- > security/selinux/hooks.c | 4 +++- > security/smack/smack_lsm.c | 4 +++- > security/tomoyo/tomoyo.c | 4 +++- > 6 files changed, 19 insertions(+), 7 deletions(-) > > diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h > index ad04761e5587..02ec717189f9 100644 > --- a/include/linux/lsm_hooks.h > +++ b/include/linux/lsm_hooks.h > @@ -2045,11 +2045,13 @@ struct lsm_info { > > extern struct lsm_info __start_lsm_info[], __end_lsm_info[]; > > -#define security_initcall(lsm) \ > +#define DEFINE_LSM(lsm) \ > static struct lsm_info __lsm_##lsm \ > __used __section(.lsm_info.init) \ > __aligned(sizeof(unsigned long)) \ > - = { .init = lsm, } > + = { \ > + > +#define END_LSM } > I am with Tetsuo on this one, I really don't like the END_LSM thing. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from youngberry.canonical.com ([91.189.89.112]:51097 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726251AbeJBDwG (ORCPT ); Mon, 1 Oct 2018 23:52:06 -0400 Subject: Re: [PATCH security-next v3 07/29] LSM: Convert security_initcall() into DEFINE_LSM() References: <20180925001832.18322-1-keescook@chromium.org> <20180925001832.18322-8-keescook@chromium.org> From: John Johansen Message-ID: Date: Mon, 1 Oct 2018 14:12:17 -0700 MIME-Version: 1.0 In-Reply-To: <20180925001832.18322-8-keescook@chromium.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Kees Cook , James Morris Cc: "Serge E. Hallyn" , Paul Moore , Stephen Smalley , Casey Schaufler , Tetsuo Handa , Mimi Zohar , linux-security-module@vger.kernel.org, selinux@tycho.nsa.gov, "Schaufler, Casey" , Jonathan Corbet , linux-doc@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <20181001211217.QGaSWtLY5ouXR6eHAkdGkOO4jkybBpWCWZ7XEU7V1TU@z> On 09/24/2018 05:18 PM, Kees Cook wrote: > Instead of using argument-based initializers, switch to defining the > contents of struct lsm_info on a per-LSM basis. This also drops > the final use of the now inaccurate "initcall" naming. > > Cc: John Johansen > Cc: James Morris > Cc: "Serge E. Hallyn" > Cc: Paul Moore > Cc: Stephen Smalley > Cc: Casey Schaufler > Cc: Tetsuo Handa > Cc: Mimi Zohar > Cc: linux-security-module@vger.kernel.org > Cc: selinux@tycho.nsa.gov > Signed-off-by: Kees Cook > --- > include/linux/lsm_hooks.h | 6 ++++-- > security/apparmor/lsm.c | 4 +++- > security/integrity/iint.c | 4 +++- > security/selinux/hooks.c | 4 +++- > security/smack/smack_lsm.c | 4 +++- > security/tomoyo/tomoyo.c | 4 +++- > 6 files changed, 19 insertions(+), 7 deletions(-) > > diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h > index ad04761e5587..02ec717189f9 100644 > --- a/include/linux/lsm_hooks.h > +++ b/include/linux/lsm_hooks.h > @@ -2045,11 +2045,13 @@ struct lsm_info { > > extern struct lsm_info __start_lsm_info[], __end_lsm_info[]; > > -#define security_initcall(lsm) \ > +#define DEFINE_LSM(lsm) \ > static struct lsm_info __lsm_##lsm \ > __used __section(.lsm_info.init) \ > __aligned(sizeof(unsigned long)) \ > - = { .init = lsm, } > + = { \ > + > +#define END_LSM } > I am with Tetsuo on this one, I really don't like the END_LSM thing.