Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2215881imm; Thu, 20 Sep 2018 09:27:55 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda56UTCo508HSRYOC4PTLM3WZFV5eAmoNlcyLjAEA5BF/dQZuWZANm4fARTRr427sW2Ypgt X-Received: by 2002:a63:8442:: with SMTP id k63-v6mr35093616pgd.388.1537460875300; Thu, 20 Sep 2018 09:27:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537460875; cv=none; d=google.com; s=arc-20160816; b=LcRik6RE8OQDvQbBYsCzONL04Tyku490oxBx8J9v3hgiChtFnuvQP+yOcEjxqN8Zbq Cq/q2fPti/La/q6GDwejugFULHzzBmajoKiMDAECFtAazrpsikfR2jQIRFDxcL75hYiD hQb6ifLm0G+Wtv8hJj4vdEJbmdWXDhVjtSuMSEwR53ZbJAtfcz3MECyb9Bjzkgoaz5B0 FA413W54ca+N2PA4tto221kVoMWZyTRaxRzXM4aJbwP/X7+wn4s2IqddGuUkHUjMDPfN skERB3UfAwq+tmskiYdz+tWMSW9OTQkh8jeJBpH6bUvrpr/a1R/Xw87AFXiVabwA1Q1K atCQ== 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=CMBlRIiz5nm06q+Q97IDTRVxqncQ0y74gJRRBx1zQAG32prE9n6EOXHGo931MckA30 KCce51PVIM1s6uWOd3N2iIagpWnuPy1kqscTIoY81CwD8EB0yXhPxKAOIuYJ2CvPeTdx PYXyyUgxkVS0gPPo/t/VdWyLbwTbw7jBh4ckyUxdD7dzech/QG7Pqwu6jCA6AhQnA8LC per0H/+4c+3yD2ijDpnaMK1qGkBxKEBGXSAA4l9ch1uKj6zlhiaSvLGVlefY9sSEZmsK pOd65J8kP2qgTh1IOB5Hjz4G76eVcRiA2lbEzO0hB+j6R3wu6GjrtgkXXtdEOKqeeEK7 tK3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=H23tsq1T; 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 q10-v6si1458458pli.202.2018.09.20.09.27.39; Thu, 20 Sep 2018 09:27:55 -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=H23tsq1T; 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 S1731253AbeITWID (ORCPT + 99 others); Thu, 20 Sep 2018 18:08:03 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:38260 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731091AbeITWIC (ORCPT ); Thu, 20 Sep 2018 18:08:02 -0400 Received: by mail-pl1-f196.google.com with SMTP id u11-v6so4593133plq.5 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=oxiPX4eUOCKPadx6dE+o3nEcAXHMNF1MOvyLG5gwXw6CMqh8u5c1dnPjMqUIqNgG6a bOMOhjJWqrSO7Lq8Gg/NNj34A2RuPBTGdopmNKJ95aePvBIZR7LK0a/HbCFFC9u7szEB DDYBiM8+JWNo3lXs9bh+0F5H3CJZdihuYI4h9BbTvQK3mJwFdMB8fuKNUi9sZ/xM/jTU Gt56oBnyw5JISl7knq56yICUMczOcY4LEtpLRyxugaIjaZDHhVMIZiIazCm5XCBIQuwE mOGhHMu7HFXWxy2eiTWSUJg2YqcfAEDtcEIV4uM6BbkX5Lm7sAso9B+jktU+AHEfJKZf 1Wbw== X-Gm-Message-State: APzg51A8c+f7225xLTlgKo9R3P2MYTYHr6J7ES4oNjflHtBm09p5EcJR 9GC0KLSKoRTDUotHu9vX/St4q3mjqSk= 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: 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