Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp500255pxa; Fri, 21 Aug 2020 12:47:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPB48xrDUiW8MSgff3m00P6+CXlb+ZlaL4FoAowOiUNDz7bOvCZSdRUogjpxYrcJuX22Dh X-Received: by 2002:a17:906:e50:: with SMTP id q16mr4729970eji.155.1598039226446; Fri, 21 Aug 2020 12:47:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598039226; cv=none; d=google.com; s=arc-20160816; b=FYSdxHr7V5CU58Fi9jvkO00UvZCNapsfoZPAPWVppbJzGBTlMOg2jZRVFLN0HztAMc oytAQwf8yVeWnePXvFxHkR8z3We7nGnoE3U1AYj8X89CLkIo+pyXCETateEfG1ilpl75 iSk4h4S95U21TYbiBJSl0YxiciUPQk39ArVyRMzBAQAFTKXcG0GSOxs+0Pcw3SYVAQrL zzCz68o94QCv2RJIQnCR6meZFgt7Y016r0v8tDjba7X4O/WWgh7a9/uLIVcgCcumhsN9 dd1DpioMqd9AURwqDhyWMc+RIludHlOT8z49BabicGCGz/29WymlfXDK+NjUT/Cqqc4r IFBw== 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=ASfOQ/kuJ12Krf5ZSehq5O7QSVOARTcDMayUR4wNtMg=; b=GYLcfNV2VLtH2hTSyRcjPKfeepbYIqoZIqUgTT8hKgPKYBuEm+og4ANJDPyWMiHocP gTUu6kBRvDesuZic5HLBpTxzoyKRlZsyJyJNKUvjhHz0Y7uLWJkTfgUSAbPwwzy0wQUB tNx9jRZ9b7we6J4zjm9wh/T5xK916FZ2/oNa0VuFU2PeC/kEXFM+CBeRDnyFBBRnvhbS mu4LxIntiImmzdgHR95t+dYaynhfm7QDy57tk1749l91GMNwRgoefpcrkq7roI1gK6nW xsNseOStsOcoHuwsXSb1SV8+1m4KFKFboV1RvXNKMb8ZEqGuEn6/omgtxPMtjFczkpuT Gg+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SBMpGd4s; 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 r14si1848777ejy.577.2020.08.21.12.46.42; Fri, 21 Aug 2020 12:47:06 -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=SBMpGd4s; 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 S1726952AbgHUTpm (ORCPT + 99 others); Fri, 21 Aug 2020 15:45:42 -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 S1726834AbgHUTo7 (ORCPT ); Fri, 21 Aug 2020 15:44:59 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5975C061344 for ; Fri, 21 Aug 2020 12:44:31 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id d19so1461957pgl.10 for ; Fri, 21 Aug 2020 12:44:31 -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=ASfOQ/kuJ12Krf5ZSehq5O7QSVOARTcDMayUR4wNtMg=; b=SBMpGd4s+UiKQvpd6FIf7mmyr/JgBt10+TVD7Ii5kFCkzS10pEX4X6/EJKoruoKLtC 84CuRzaeQOC+BRoI8+VIgcXpHdJXsz8pSr5eHHUk9OeOiMGvPWNv9o2E266UGfgRx9Rg lryfQ7kHnS4YgNbKzDh3sJwiGeiFPyEFPetDE= 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=ASfOQ/kuJ12Krf5ZSehq5O7QSVOARTcDMayUR4wNtMg=; b=ZGcGnuOVbLZT9j/SLZEPiohfmKMVMUHchbiPX0i9RzP5srLBxZC1x4e1GXLCGuSJV/ Xoo+y9ZIoq09rVxtKeyBzdaRQwMpxOpBZ/ZaJHYga+cSpftHaJ0oLxqQJ6gKCMUJsS+Y KeYUXGRgLKs0kB4fGys3J0Zghi4k8g43zg7fkc3FytAPWUf3xDSWV2PWWSeGVdudfmaW ALZku9Da4rpytzuy9v1VRHJ8bBLNJAVgOvFjThDoQ7kekn3WgaTTeV6lhBOrN7id1JSk Ufg6Gk5h5EfDtIJ6pulO+xNDjCKlaNKk1UDoIiIUYlPyVLXz6ZkFbtZYhY0NtPEsCY+Z aiYQ== X-Gm-Message-State: AOAM533XnoO0eYlWKKdZ3EmzWUqvEVb6erAmvdelSvZoCEHazerWcK02 iv1NINAuP3HQcS2nh3EhMUPQdw== X-Received: by 2002:aa7:83cf:: with SMTP id j15mr3532874pfn.251.1598039071474; Fri, 21 Aug 2020 12:44:31 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id q7sm3300258pfu.133.2020.08.21.12.44.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2020 12:44:30 -0700 (PDT) From: Kees Cook To: Ingo Molnar Cc: Kees Cook , Catalin Marinas , Mark Rutland , Ard Biesheuvel , Peter Collingbourne , James Morse , Borislav Petkov , Ingo Molnar , Russell King , Masahiro Yamada , Arvind Sankar , Nick Desaulniers , 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 20/29] arm/boot: Handle all sections explicitly Date: Fri, 21 Aug 2020 12:43:01 -0700 Message-Id: <20200821194310.3089815-21-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 warning on orphan sections, use common macros for debug sections, discards, and text stubs. Add discards for unwanted .note, and .rel sections. Signed-off-by: Kees Cook --- arch/arm/boot/compressed/vmlinux.lds.S | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/arm/boot/compressed/vmlinux.lds.S b/arch/arm/boot/compressed/vmlinux.lds.S index 09ac33f52814..b914be3a207b 100644 --- a/arch/arm/boot/compressed/vmlinux.lds.S +++ b/arch/arm/boot/compressed/vmlinux.lds.S @@ -2,6 +2,7 @@ /* * Copyright (C) 2000 Russell King */ +#include #ifdef CONFIG_CPU_ENDIAN_BE8 #define ZIMAGE_MAGIC(x) ( (((x) >> 24) & 0x000000ff) | \ @@ -17,8 +18,11 @@ ENTRY(_start) SECTIONS { /DISCARD/ : { + COMMON_DISCARDS *(.ARM.exidx*) *(.ARM.extab*) + *(.note.*) + *(.rel.*) /* * Discard any r/w data - this produces a link error if we have any, * which is required for PIC decompression. Local data generates @@ -36,9 +40,7 @@ SECTIONS *(.start) *(.text) *(.text.*) - *(.gnu.warning) - *(.glue_7t) - *(.glue_7) + ARM_STUBS_TEXT } .table : ALIGN(4) { _table_start = .; @@ -128,12 +130,10 @@ SECTIONS PROVIDE(__pecoff_data_size = ALIGN(512) - ADDR(.data)); PROVIDE(__pecoff_end = ALIGN(512)); - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } + STABS_DEBUG + DWARF_DEBUG + ARM_DETAILS + + ARM_ASSERTS } ASSERT(_edata_real == _edata, "error: zImage file size is incorrect"); -- 2.25.1