Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2431183imm; Sat, 15 Sep 2018 17:34:36 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb5C+IbbimSsT4u3ufkJjQiDjUbLYL2CrP5w6a8gtMHPb25nAMqWy8LaEQgvdK7SbhwubbW X-Received: by 2002:a63:6c04:: with SMTP id h4-v6mr4907662pgc.290.1537058076295; Sat, 15 Sep 2018 17:34:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537058076; cv=none; d=google.com; s=arc-20160816; b=WqDAGjeZjzDjG8/sPdmEpwT9Jx9OQiio2aDdWPPLghPuZiGU6rcN+1fLXrX4SrkayX Dh8ukSxZyK2QX3VEYO/XNxSB0X7Z7FQtWZtkE7FxIsF/fBG3AZN0JvNce5I6Rv7vLKCo /ghgocWBOE3t8PrwASC/yJRgAC7bU+9W8R3EzeOiDLHHQR2WjJijuqEAKQQKIkOmbwbN oxeIIXfCCHsbfKrI2nlHANGj7YPBRMyXoUt/VeM/v+MOTQtCYasB+Z5QLl1lOubZ6+2G mW9DF8ZCvsvOIpdvWuskW1GuSoIdOzzEgVcP2YKwsMIzqhIWX1s6mJNEQAyVxWdomX0E mSHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=Zg+yA6iBpUZzxZCfC7FbRgVPvRB/0N0Ik3Iu+95jWHE=; b=z4FVk3TEWztTEumNQIk83+TrY8YR/o8cr+ixACp4X5pc8wUxzdiEFq2VwYSEmhkk/S /UI8SnhUr3Dwzn51ZrMrBht36Zt8B58zA4g36xAKK6VpS7uKPaUp7Kzco6+31KhmYhyE MP+yhZECLqMM41YTT4D5TV9fJ+9iejMfOwqinWgw8tbYT1Grk/DsQ6aTunEG7cHjDdhj oLpcThLk7b6mjzeMfXSL2O2PPoDwts1BJ5hOguxWtft94Ag5qZo6Vjzt22lgvPdoSrcF vyvhAz2HduqOQg1aIb5xxCORZn4qQesV1PRk6YlvU90PLQUR6cyRU39U3hc1TXazNaOO BbYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=eB8ZoZ4t; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z25-v6si12069563pfm.152.2018.09.15.17.34.21; Sat, 15 Sep 2018 17:34:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=eB8ZoZ4t; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728419AbeIPFxZ (ORCPT + 99 others); Sun, 16 Sep 2018 01:53:25 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:34480 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728036AbeIPFwD (ORCPT ); Sun, 16 Sep 2018 01:52:03 -0400 Received: by mail-pl1-f194.google.com with SMTP id f6-v6so5797925plo.1 for ; Sat, 15 Sep 2018 17:31:07 -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=eB8ZoZ4tMyIPviAYdKjqes9M3w8pKOe5njrcU+iiJiycgH0TQa5knqhL7RzMCRSzsh SsTcm9DpzGnUbXAmqVLH3t2fUBOhQ/4znosFarR4rI1+BembNK+S9BVBT3yqyrTrugA7 ebU8PdO/MYadi8BOY9h+SAxStt9PTOTauO2dg= 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=IJg55ICF69r66KcfamcmWytyK3WgzeYAbif1am4h3WSiv0FUlMknDXRCysEpgvigod a9iQh8qCveBiJ7xKxX0G0R6BsBZbQgKczf5wCN7dJWarvKCPX8REb5UVW9ByprCorqEc uEtLq4LJ4bYBFq59U3CMmR5YOWJ1uOeDYTVHdiSbeCVgo0ViTikI/dz0sjlBdYNZlM0d 0NrHE+TQge3zDY/st9GXdgPr7iNlRfwP2K7joYXWaRB6/y0ugy4As5VFTWu1XoX+DRsv vL6Jkblan0h0tYlbk938xX7LDi+6L7uGM/VdweRUxnR1Kssam5teIa3+Nm68DzK78R3p IseA== X-Gm-Message-State: APzg51DP7+bqRji7Zed8YjfmyOzwvC0t2TWysbeYMZMlab8XcTScDucP P26i3Rydh/oIJHpKPeB3U4Stgg== X-Received: by 2002:a17:902:b212:: with SMTP id t18-v6mr18849902plr.107.1537057867383; Sat, 15 Sep 2018 17:31:07 -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 r81-v6sm15149679pfa.18.2018.09.15.17.31.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Sep 2018 17:31:03 -0700 (PDT) From: Kees Cook To: James Morris Cc: Kees Cook , Casey Schaufler , John Johansen , Tetsuo Handa , Paul Moore , Stephen Smalley , "Schaufler, Casey" , LSM , LKLM Subject: [PATCH 01/18] vmlinux.lds.h: Avoid copy/paste of security_init section Date: Sat, 15 Sep 2018 17:30:42 -0700 Message-Id: <20180916003059.1046-2-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180916003059.1046-1-keescook@chromium.org> References: <20180916003059.1046-1-keescook@chromium.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); \ -- 2.17.1