From patchwork Tue Sep 25 00:18:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10613131 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CD0FC14DA for ; Tue, 25 Sep 2018 00:20:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B9CBF29483 for ; Tue, 25 Sep 2018 00:20:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD6CF29EE6; Tue, 25 Sep 2018 00:20:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC7E929483 for ; Tue, 25 Sep 2018 00:20:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726316AbeIYGZX (ORCPT ); Tue, 25 Sep 2018 02:25:23 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:35212 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728288AbeIYGX1 (ORCPT ); Tue, 25 Sep 2018 02:23:27 -0400 Received: by mail-pf1-f196.google.com with SMTP id p12-v6so9924383pfh.2 for ; Mon, 24 Sep 2018 17:18:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SJSMq1IylsdmDC6tKe2QXG4rx4NTxkWXmcEscNNPrNQ=; b=UpIzsCl5FvnGIXOYOS5hU7C0YL8/S4Y7+Iu2kiG/v6so5wwTQXrzw35wrpyCpEL897 sxUfG0q2+0cUvDcYRWkPSiOyVJk4YQGr/pZwOUo4ipAp+aFACSLSOnU3azlAGxzkPNj7 mpW7AWWrtVaksxrjiVZSpG+Ewns9rmBDjgwRg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SJSMq1IylsdmDC6tKe2QXG4rx4NTxkWXmcEscNNPrNQ=; b=mbNjomZae0E61QOsb3a5+MgEUr1KQIOtZJsClGQc3K0krYygyTZDfQMiwFR/GiWv/Q SidmghxkZIm9ydpsQxf06JiHdOzyjMRIlbAydQsmZEfs4+FyYij8nnU5I5YfagyXBX1x Hf61W7RaT99hNyQF7vdH9dcuM2hNmQil4JmFEzg2HAmPe5ZDrcFllY1/JX0guW0yZwKB v8AwG8b6PTeVCltNjnh1hcUIL6Jd9BM58+oTgTvoIhwdRhslswbLqHJTcGXSlxzPpBq0 denLIGrMYevgBSygR73uEVlpbmUqpeiQUtc89vlD17PKCHhnIGkhfwp5XUe7QswRGELE TBbg== X-Gm-Message-State: ABuFfoga/mQr4l3Ng1U+1di4dZJN05//0f90iYsypVjDF29AzQyIooOy gfyBDgf5Ooej+sr21ahIQb8T0A== X-Google-Smtp-Source: ACcGV61mKHO+aF35FoDAEPJrqFH6Bd/hDjOvjLpCfYhZZWXD+Oz2LX6VxlVxJzxlp3g7CAigQgdZPw== X-Received: by 2002:a17:902:6b44:: with SMTP id g4-v6mr1002294plt.50.1537834722042; Mon, 24 Sep 2018 17:18:42 -0700 (PDT) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id h82-v6sm549378pfa.173.2018.09.24.17.18.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Sep 2018 17:18:37 -0700 (PDT) From: Kees Cook To: James Morris Cc: Kees Cook , Arnd Bergmann , linux-arch@vger.kernel.org, Casey Schaufler , John Johansen , Tetsuo Handa , Paul Moore , Stephen Smalley , "Schaufler, Casey" , LSM , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH security-next v3 02/29] vmlinux.lds.h: Avoid copy/paste of security_init section Date: Mon, 24 Sep 2018 17:18:05 -0700 Message-Id: <20180925001832.18322-3-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180925001832.18322-1-keescook@chromium.org> References: <20180925001832.18322-1-keescook@chromium.org> Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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: James Morris 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); \