Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp500591pxa; Fri, 21 Aug 2020 12:47:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPE/SkW8cpas/fK9W6fKconauYAFEFMKryLg2ANBzQCwVhnkmr46oXdtdGvl7g6llNvjls X-Received: by 2002:a17:907:9483:: with SMTP id dm3mr4502638ejc.333.1598039262631; Fri, 21 Aug 2020 12:47:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598039262; cv=none; d=google.com; s=arc-20160816; b=fjapZqD2gTCxt42IQFLmca+RImPMiZorX9E121PPO81MSDCcAiJrb5KcvAAlPj4nEM t0sqTrx5JxeyWJArary4HNDPSdy9Q1jRZi8P4NPdxnL+36ne/X1yto2KgVB901qiF1nQ I/N/hjhkGmcfZesmt+FcwWkdjo8pOj7OWrsTe3yOqiv0/vMViaphIfousKkoX6eEjp68 FUiVZubHVw3FRdMyYzONpwWReKbSgUxFK61v2DZahuZ4hQxcFn0mKWvBNtiikA5GHIQD uc/LHDjiq448nZmzlfst4ShtkMNIL2B/lm6xausUmI8BAWnNmtXnMTyJt5bQrnpX/TVF ZbFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5FUB3tjALH2XvfA6zdfdUjwI0GuDEI1l9XpW++dZco8=; b=s8ra3T8J75JUxEuiVQOlWuQx1lKQg7u09voLgOptr2g+6eWBYvn51MmD2fCH4eWT68 t4jtTyH9iFDYI4GVcQIlYfKcgDr5cQdS6QVpFnDXCtwYRSRVuL5GmrBb1jT+3/i+z+qN IonQ2aaUJ5Vnjfnweucdb2Pc6kV2epRBkzQbDkj+cF3wdF5RPn084wfhsQwkFk5QJGka HJ/4Pwr+vMQuKvDfZGJyd7nFQ6/4VYxBg2iSWCFntuRto28EeJoQnf6Fcc5bcVOYG4K+ 1sWqykviyeTzVZTfvqgHdKLDNhoDtZlSNpWgB4Fl9T3tntfyXlHizcmyoS8tvhl+puKE QeLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dwH4hSFn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id v25si1800652ejg.91.2020.08.21.12.47.19; Fri, 21 Aug 2020 12:47:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dwH4hSFn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1727014AbgHUTqH (ORCPT + 99 others); Fri, 21 Aug 2020 15:46:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726751AbgHUToh (ORCPT ); Fri, 21 Aug 2020 15:44:37 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 183C0C0617BB for ; Fri, 21 Aug 2020 12:44:28 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id j21so1464127pgi.9 for ; Fri, 21 Aug 2020 12:44:28 -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 :mime-version:content-transfer-encoding; bh=5FUB3tjALH2XvfA6zdfdUjwI0GuDEI1l9XpW++dZco8=; b=dwH4hSFn+M/JShOAvoDuz49SFgRTdFlTWo6hGZr9AwLMcNzDM8CCErZhyY7e1uO/Xx uqiHf1O97j60Dk9p27VnNcHgm3AvxP83RVdw0qpFJ6YHuX6CzA2/zf5uWMROb5mfhFC6 0KXGu5Y3b4E5gPfjCLnwSk3EL5h0NSoEoS0pw= 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:mime-version:content-transfer-encoding; bh=5FUB3tjALH2XvfA6zdfdUjwI0GuDEI1l9XpW++dZco8=; b=LIuTbV3jaeUlRBab2PpIxUaW1tpNHCf+lNdT9VzoPVixXPOyguesS5/lXwjFhjeoR5 XrmNR1spw8vsovyQI4CtJBbSsGw7gcCoCyBmUeIl+Eww9atm8DBgX03BkkE9ZQ/ArRFp cSk+Jp4E8Ug6cTTVrSZwwRJ0s2EKZiZ/V7cbqD+oBR9NwshD+GLWJa/JwrilqbULDui4 9qPiDBwDcvB2Yzgl+ra/xmYyis3PHJA8eeO7TnfFr7Si69a1PhCvlS0lBG3x7UrdP2Nv sRQepm75LT4PqnsfsLZM8vnbimF9i+Zxh7ppZVT28PjOxmx0QUsnjtYE0+SNX46u5L8E HJ1w== X-Gm-Message-State: AOAM530TJsDUK+hOG7NQfSbsxQlsoKTp1Xb00SjTUSs7CbeHWpePK5ES h6E2DMoFGJ3cnSgR7jeTsk5wyQ== X-Received: by 2002:a62:2ace:: with SMTP id q197mr3509274pfq.77.1598039067613; Fri, 21 Aug 2020 12:44:27 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id u14sm3393575pfm.103.2020.08.21.12.44.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2020 12:44:27 -0700 (PDT) From: Kees Cook To: Ingo Molnar Cc: Kees Cook , Nick Desaulniers , Fangrui Song , Catalin Marinas , Mark Rutland , Ard Biesheuvel , Peter Collingbourne , James Morse , Borislav Petkov , Ingo Molnar , Russell King , Masahiro Yamada , Arvind Sankar , Nathan Chancellor , Arnd Bergmann , x86@kernel.org, clang-built-linux@googlegroups.com, linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 16/29] arm/build: Explicitly keep .ARM.attributes sections Date: Fri, 21 Aug 2020 12:42:57 -0700 Message-Id: <20200821194310.3089815-17-keescook@chromium.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200821194310.3089815-1-keescook@chromium.org> References: <20200821194310.3089815-1-keescook@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In preparation for adding --orphan-handling=warn, explicitly keep the .ARM.attributes section (at address 0[1]) by expanding the existing ELF_DETAILS macro into ARM_DETAILS. [1] https://reviews.llvm.org/D85867 Suggested-by: Nick Desaulniers Link: https://lore.kernel.org/lkml/CAKwvOdk-racgq5pxsoGS6Vtifbtrk5fmkmnoLxrQMaOvV0nPWw@mail.gmail.com/ Reviewed-by: Fangrui Song Signed-off-by: Kees Cook --- arch/arm/include/asm/vmlinux.lds.h | 4 ++++ arch/arm/kernel/vmlinux-xip.lds.S | 2 +- arch/arm/kernel/vmlinux.lds.S | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/vmlinux.lds.h b/arch/arm/include/asm/vmlinux.lds.h index a08f4301b718..c4af5182ab48 100644 --- a/arch/arm/include/asm/vmlinux.lds.h +++ b/arch/arm/include/asm/vmlinux.lds.h @@ -52,6 +52,10 @@ ARM_MMU_DISCARD(*(__ex_table)) \ COMMON_DISCARDS +#define ARM_DETAILS \ + ELF_DETAILS \ + .ARM.attributes 0 : { *(.ARM.attributes) } + #define ARM_STUBS_TEXT \ *(.gnu.warning) \ *(.glue_7) \ diff --git a/arch/arm/kernel/vmlinux-xip.lds.S b/arch/arm/kernel/vmlinux-xip.lds.S index 904c31fa20ed..57fcbf55f913 100644 --- a/arch/arm/kernel/vmlinux-xip.lds.S +++ b/arch/arm/kernel/vmlinux-xip.lds.S @@ -150,7 +150,7 @@ SECTIONS _end = .; STABS_DEBUG - ELF_DETAILS + ARM_DETAILS } /* diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index bb950c896a67..1d3d3b599635 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S @@ -149,7 +149,7 @@ SECTIONS _end = .; STABS_DEBUG - ELF_DETAILS + ARM_DETAILS } #ifdef CONFIG_STRICT_KERNEL_RWX -- 2.25.1