From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Johansen Subject: Re: [PATCH security-next v3 02/29] vmlinux.lds.h: Avoid copy/paste of security_init section Date: Mon, 1 Oct 2018 14:05:51 -0700 Message-ID: <6adced07-f3a9-a098-3f56-ba5fd2e03bcb@canonical.com> References: <20180925001832.18322-1-keescook@chromium.org> <20180925001832.18322-3-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-3-keescook@chromium.org> Content-Language: en-GB Sender: linux-kernel-owner@vger.kernel.org To: Kees Cook , James Morris Cc: Arnd Bergmann , linux-arch@vger.kernel.org, Casey Schaufler , Tetsuo Handa , Paul Moore , Stephen Smalley , "Schaufler, Casey" , LSM , Jonathan Corbet , linux-doc@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: > Avoid copy/paste by defining SECURITY_INIT in terms of SECURITY_INITCALL. > > Cc: Arnd Bergmann > Cc: linux-arch@vger.kernel.org > Signed-off-by: Kees Cook Reviewed-by: John Johansen > --- > include/asm-generic/vmlinux.lds.h | 13 ++++++------- > 1 file changed, 6 insertions(+), 7 deletions(-) > > diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h > index 7b75ff6e2fce..934a45395547 100644 > --- a/include/asm-generic/vmlinux.lds.h > +++ b/include/asm-generic/vmlinux.lds.h > @@ -473,13 +473,6 @@ > #define RODATA RO_DATA_SECTION(4096) > #define RO_DATA(align) RO_DATA_SECTION(align) > > -#define SECURITY_INIT \ > - .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \ > - __security_initcall_start = .; \ > - KEEP(*(.security_initcall.init)) \ > - __security_initcall_end = .; \ > - } > - > /* > * .text section. Map to function alignment to avoid address changes > * during second ld run in second ld pass when generating System.map > @@ -798,6 +791,12 @@ > KEEP(*(.security_initcall.init)) \ > __security_initcall_end = .; > > +/* Older linker script style for security init. */ > +#define SECURITY_INIT \ > + .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \ > + SECURITY_INITCALL \ > + } > + > #ifdef CONFIG_BLK_DEV_INITRD > #define INIT_RAM_FS \ > . = ALIGN(4); \ > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from youngberry.canonical.com ([91.189.89.112]:50961 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725936AbeJBDph (ORCPT ); Mon, 1 Oct 2018 23:45:37 -0400 Subject: Re: [PATCH security-next v3 02/29] vmlinux.lds.h: Avoid copy/paste of security_init section References: <20180925001832.18322-1-keescook@chromium.org> <20180925001832.18322-3-keescook@chromium.org> From: John Johansen Message-ID: <6adced07-f3a9-a098-3f56-ba5fd2e03bcb@canonical.com> Date: Mon, 1 Oct 2018 14:05:51 -0700 MIME-Version: 1.0 In-Reply-To: <20180925001832.18322-3-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: Arnd Bergmann , linux-arch@vger.kernel.org, Casey Schaufler , Tetsuo Handa , Paul Moore , Stephen Smalley , "Schaufler, Casey" , LSM , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <20181001210551.doQBdsopjowTz0Y91rz3VjIW1jDe63qPr_8xZWgb72E@z> On 09/24/2018 05:18 PM, Kees Cook wrote: > Avoid copy/paste by defining SECURITY_INIT in terms of SECURITY_INITCALL. > > Cc: Arnd Bergmann > Cc: linux-arch@vger.kernel.org > Signed-off-by: Kees Cook Reviewed-by: John Johansen > --- > include/asm-generic/vmlinux.lds.h | 13 ++++++------- > 1 file changed, 6 insertions(+), 7 deletions(-) > > diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h > index 7b75ff6e2fce..934a45395547 100644 > --- a/include/asm-generic/vmlinux.lds.h > +++ b/include/asm-generic/vmlinux.lds.h > @@ -473,13 +473,6 @@ > #define RODATA RO_DATA_SECTION(4096) > #define RO_DATA(align) RO_DATA_SECTION(align) > > -#define SECURITY_INIT \ > - .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \ > - __security_initcall_start = .; \ > - KEEP(*(.security_initcall.init)) \ > - __security_initcall_end = .; \ > - } > - > /* > * .text section. Map to function alignment to avoid address changes > * during second ld run in second ld pass when generating System.map > @@ -798,6 +791,12 @@ > KEEP(*(.security_initcall.init)) \ > __security_initcall_end = .; > > +/* Older linker script style for security init. */ > +#define SECURITY_INIT \ > + .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \ > + SECURITY_INITCALL \ > + } > + > #ifdef CONFIG_BLK_DEV_INITRD > #define INIT_RAM_FS \ > . = ALIGN(4); \ >