From patchwork Thu Sep 20 16:23:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10608093 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 4182A913 for ; Thu, 20 Sep 2018 16:25:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31D212DDB5 for ; Thu, 20 Sep 2018 16:25:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 262832E00F; Thu, 20 Sep 2018 16:25:30 +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 CEAD62DDB5 for ; Thu, 20 Sep 2018 16:25:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731163AbeITWJj (ORCPT ); Thu, 20 Sep 2018 18:09:39 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:43581 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731072AbeITWID (ORCPT ); Thu, 20 Sep 2018 18:08:03 -0400 Received: by mail-pl1-f195.google.com with SMTP id 38-v6so4589464plc.10 for ; Thu, 20 Sep 2018 09:23:47 -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=Zg+yA6iBpUZzxZCfC7FbRgVPvRB/0N0Ik3Iu+95jWHE=; b=H23tsq1ToF0dxmUZ+HTryRkBaWmjTb71c3wjGIuwxZcwUogcbdfKloN5fXoL0DReiz 6RnBfkuqUS3cXhotka6z/0XQCimbvlLtWXQcmGu0OOKmVKX9EfR2uUPpZLdOVizZ4S0o vN5OYaQjgaj7wy1XGKCtnyMIyvnJi2tka8WR4= 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=Zg+yA6iBpUZzxZCfC7FbRgVPvRB/0N0Ik3Iu+95jWHE=; b=kop7OJu0bDl2zITSf+BQEQMFnanv2t7BD10gpR5dsDqoNRO9S4OeCmmBBXw89w1Ivz +3acXOQICjtcWZ8a6ivg6eU+5tq07HVq1TiNKu/HBVFc8yU/2z74/gGdDa8h3DAlT+ON Zr2cnOf/mIAHH1bIHIFCCM3FsTapiRe6W3kMOZ1YM9PN2Wl6FkTf0YlumeLGvGkpQzXa W5/OYRDRi+7yBA9N4Obxw1q3ssRdlY4TWGhzdKsV7KH1v29lqt6Ru4pP6gh2aL4DibVV SQPyHv8m4wZnW8vctC2UkUTNGgNmCzxARYE808/Of7o5FZ0LWOtIdVHGqOY8LgngVsK/ rpLg== X-Gm-Message-State: APzg51BGAm5jvZGO8Tmj/j8eQvrpFTakOwucnYewxODEcWMEwXS22ZL9 fdWQBsOXcNxYhtlQCQHvf4ASdw== X-Google-Smtp-Source: ANB0VdbNXm/OIOfuzZqfwwbkUTCJXuevcYNHWasLdUBmfSIo7BtFySaQm1q2bWg7ymD89BrTcDIlww== X-Received: by 2002:a17:902:b78c:: with SMTP id e12-v6mr3044057pls.67.1537460627412; Thu, 20 Sep 2018 09:23:47 -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 a19-v6sm41547245pfj.38.2018.09.20.09.23.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Sep 2018 09:23:43 -0700 (PDT) From: Kees Cook To: James Morris Cc: Kees Cook , Casey Schaufler , John Johansen , Tetsuo Handa , Paul Moore , Stephen Smalley , "Schaufler, Casey" , LSM , Jonathan Corbet , linux-doc@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH security-next v2 02/26] vmlinux.lds.h: Avoid copy/paste of security_init section Date: Thu, 20 Sep 2018 09:23:14 -0700 Message-Id: <20180920162338.21060-3-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180920162338.21060-1-keescook@chromium.org> References: <20180920162338.21060-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. Signed-off-by: Kees Cook --- 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); \