Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp501588pxa; Fri, 21 Aug 2020 12:49:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPLjXYXVtpp737XvScvWp6wNftK9Pyo+aX2ZFinCSS1V3tGFH4MD5KDl7qDdGclm0rH0qR X-Received: by 2002:aa7:c2c6:: with SMTP id m6mr4600647edp.118.1598039377620; Fri, 21 Aug 2020 12:49:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598039377; cv=none; d=google.com; s=arc-20160816; b=ezI4w5tedUSJ2DwkxLI1kx8+2SrzGtX7kt5bF309piJ26BhTNLVftk89mWU3e7LC71 ne5aGQ+0838bHsN105AA/9Jzh+jHKKXl+DWaNNSM/AQlWRVYZon49VBRpd95/cRHJXDG KJsXfZRmVSW0h8rFGTcVmwz8IvmvmfzMaZrXIT/qHqauYSHDM16hPu4bXNKll056A6DV NkwrkB/WOLADnunWud4y4vTMq4J1BUgj/nMwwlepl3B6hz17Lz8ies6BqEXL30jKOk2G 1rVi4xvp9m2zj3cz4s2O/oswUhiqzV4625Z/v7RakJQU8WS4hIKCQRiTg0tEANJo1ed1 Ikcg== 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=XUX2/F199MEO0A5MxoqXk+lRBktQIKiWBEBF3o8wM8g=; b=u77VUD1m+FJqlBEzmi43rpZGWYNeZ7Gw2sS70ODXIlwoHCOqMW7G+EQCa2pbhYdAaU WlGrDMKuRI++VJyC8QrvBwVmneWVliizKU6zlvhS48Hm7xKbQVAOdnEdC4IN6qloYMLS m+0t6vlvuf1ybFJzGXV0GfxFe72Ytk/WD9w4zcxpspKHPFTUW/zrKzEqiRqAh0gIrQla G7CfNVfr2t3Z6D4yDZpLNG4h44JaJUkC/h1zSxsISCcBiK0zl01wp8gmwqs2NHrJQ3Vp ZJQRoF4H+bROkTIHcje6GtMc5k3TZIB4tSgoQJSm4Zu/aDsQa3HM84R11j2+Tr0kCE5l 3uVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=j1sa53Se; 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 h17si1866084ejq.352.2020.08.21.12.49.14; Fri, 21 Aug 2020 12:49:37 -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=j1sa53Se; 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 S1727005AbgHUTqB (ORCPT + 99 others); Fri, 21 Aug 2020 15:46:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726759AbgHUToi (ORCPT ); Fri, 21 Aug 2020 15:44:38 -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 74C80C0617BD for ; Fri, 21 Aug 2020 12:44:28 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id s15so1467162pgc.8 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=XUX2/F199MEO0A5MxoqXk+lRBktQIKiWBEBF3o8wM8g=; b=j1sa53Ser9mup3Pv1fHYCK7qkFQ8JkWE5b9bJ2WYsLFPuFUJI+77KvzI8C6EnJ19+U HOx5t7CYCG20lCrUcZggNSgWvsVF0d2eqTd4pLYBAA6zYjF6GRTQ4yiYD74vhBk3D1th 23E2s7EIY6h+0C6fBfpGXayEHW+B0c00eaZ9Q= 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=XUX2/F199MEO0A5MxoqXk+lRBktQIKiWBEBF3o8wM8g=; b=CpRZTQb+vJqj+M5xxTDfZFA+I0l29pRTRiz1vZ7qfmrLusi6JEjCv3Q79VUXd0Wr3O 0mJ8M54Bu/weqh6WCQj1EB2KsEV8RC0+2vvqA4nXbSLH5o6EobIZf8PvUKkHmM8W+0kZ c5P6fp/edcJQfXJXFeYR8k024GxJHERrj/kohd+ONU4PMq5tm+/+Podht+Z1U2qx1N5m bDiVaCSbqtINmCrLtu9gGADNms7QrCq6znb2tFxteSPl4tQnzNsNKZM23OOmP0VXK7fH +k8fIwSQTps0H+1ZUWymR/ujIcRS79BH3tSE28bijaX1Zq8cgZnZseMatxR/ahCsqWax /LEg== X-Gm-Message-State: AOAM533pXFzkDomboLltE+BgoLnUGpwsgIwYs/F0MZpiF3+DRN/7sXyy fUI0DxFPxXtqKrw5rxb7MtrwzA== X-Received: by 2002:a65:679a:: with SMTP id e26mr3467507pgr.167.1598039067977; 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 p20sm2611002pjz.49.2020.08.21.12.44.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2020 12:44:25 -0700 (PDT) From: Kees Cook To: Ingo Molnar Cc: Kees Cook , Ard Biesheuvel , Will Deacon , Catalin Marinas , Mark Rutland , 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 10/29] arm64/build: Remove .eh_frame* sections due to unwind tables Date: Fri, 21 Aug 2020 12:42:51 -0700 Message-Id: <20200821194310.3089815-11-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 Avoid .eh_frame* section generation by making sure both CFLAGS and AFLAGS contain -fno-asychronous-unwind-tables and -fno-unwind-tables. With all sources of .eh_frame now removed from the build, drop this DISCARD so we can be alerted in the future if it returns unexpectedly once orphan section warnings have been enabled. Suggested-by: Ard Biesheuvel Acked-by: Will Deacon Signed-off-by: Kees Cook --- arch/arm64/Makefile | 5 ++++- arch/arm64/kernel/vmlinux.lds.S | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 55bc8546d9c7..6de7f551b821 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -47,13 +47,16 @@ endif KBUILD_CFLAGS += -mgeneral-regs-only \ $(compat_vdso) $(cc_has_k_constraint) -KBUILD_CFLAGS += -fno-asynchronous-unwind-tables KBUILD_CFLAGS += $(call cc-disable-warning, psabi) KBUILD_AFLAGS += $(compat_vdso) KBUILD_CFLAGS += $(call cc-option,-mabi=lp64) KBUILD_AFLAGS += $(call cc-option,-mabi=lp64) +# Avoid generating .eh_frame* sections. +KBUILD_CFLAGS += -fno-asynchronous-unwind-tables -fno-unwind-tables +KBUILD_AFLAGS += -fno-asynchronous-unwind-tables -fno-unwind-tables + ifeq ($(CONFIG_STACKPROTECTOR_PER_TASK),y) prepare: stack_protector_prepare stack_protector_prepare: prepare0 diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S index 13fc2ec46aae..c2b8426bf4bd 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S @@ -94,7 +94,6 @@ SECTIONS *(.discard.*) *(.interp .dynamic) *(.dynsym .dynstr .hash .gnu.hash) - *(.eh_frame) } . = KIMAGE_VADDR + TEXT_OFFSET; -- 2.25.1