Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3896924ybv; Tue, 25 Feb 2020 09:13:50 -0800 (PST) X-Google-Smtp-Source: APXvYqyYO39vP1hdpr5r+6CZuQyuo14Zm5odub+wVZNZVFSTAub9XgXzwjddiQ0L4JIKFfP4SW5f X-Received: by 2002:a05:6830:139a:: with SMTP id d26mr47085502otq.75.1582650829973; Tue, 25 Feb 2020 09:13:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582650829; cv=none; d=google.com; s=arc-20160816; b=ccskHjzC1qEfHxrtGGVICFkabM3MLV2rUbFPkX6nr1/MFKYcDpuQE3l3unRb01Ixn6 BsqQkFkMhPz8hJW1+du69278/wRcSmOvnUQCMB/kjG/bWPyga8kRShCxXGX5zx0NskeW 4LpEnLJp27JFDVLu/aKuT5OFZP88iYocxMbf/8zP/LkOLsnimWeOM2ORi1aFZTyzUf/Y O5XS1+0yNzSdj/6/6xpxm4h6vXw0q+b0k7JMBu/Woif4eOogblhjakLMJZSTOIkT929j UiBgjTgB7Upk5T+8Q4NQK9LLosAYlqEtLYV6QI8wK07kuFtKCNMVim8T3B+Iw9NNLgQL 7FDA== 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 :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=rNqqJaC8ZC7B8bSQxhkUmvyCsLZAXhjGnUiV9bYYbLg=; b=We3nrF3MWrdd6yBlt0yIdYZHIzUu4OJqpFqe9Xd0HDQe1O6hzRPFgoHR29qfo58YUB uGBL/40P3DUtdldMUM17Sud03lD3dsWxGreBDiO9DPGIlTbjo6LdiH/4EUvxk1qun9jO 9vMycYk3q2SGaib87PlKO5EKhA7Zh/02g7brK7KwQZTpTVkXnSbf0so3ihq1z2QmE4AJ R52uYVuSNbbQ8N9obKjcFsOmQ96t9zNsMxhmjPqWslcUR7pNLjfJnxOiD237AeW4hTyG 1SMpS0ZcASl+XN5Wba2djI7ixLw3dSwP3UPtuLLceVikVJwIcmTTyyhZmYHPmseqWHbX Pvqw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t11si7276873oih.187.2020.02.25.09.13.37; Tue, 25 Feb 2020 09:13:49 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730908AbgBYQx3 (ORCPT + 99 others); Tue, 25 Feb 2020 11:53:29 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:53928 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730704AbgBYQx3 (ORCPT ); Tue, 25 Feb 2020 11:53:29 -0500 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1j6dSV-0007Y9-0x; Tue, 25 Feb 2020 17:53:23 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 9FB261C214D; Tue, 25 Feb 2020 17:53:22 +0100 (CET) Date: Tue, 25 Feb 2020 16:53:22 -0000 From: "tip-bot2 for Arvind Sankar" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/boot] x86/*/Makefile: Use -fno-asynchronous-unwind-tables to suppress .eh_frame sections Cc: Fangrui Song , Arvind Sankar , Borislav Petkov , Nathan Chancellor , Nick Desaulniers , Kees Cook , x86 , LKML In-Reply-To: <20200224232129.597160-2-nivedita@alum.mit.edu> References: <20200224232129.597160-2-nivedita@alum.mit.edu> MIME-Version: 1.0 Message-ID: <158264960240.28353.7022349340832312858.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/boot branch of tip: Commit-ID: 003602ad5516e59940de42e44c8d8033387bb363 Gitweb: https://git.kernel.org/tip/003602ad5516e59940de42e44c8d8033387bb363 Author: Arvind Sankar AuthorDate: Mon, 24 Feb 2020 18:21:28 -05:00 Committer: Borislav Petkov CommitterDate: Tue, 25 Feb 2020 13:18:29 +01:00 x86/*/Makefile: Use -fno-asynchronous-unwind-tables to suppress .eh_frame sections While discussing a patch to discard .eh_frame from the compressed vmlinux using the linker script, Fangrui Song pointed out [1] that these sections shouldn't exist in the first place because arch/x86/Makefile uses -fno-asynchronous-unwind-tables. It turns out this is because the Makefiles used to build the compressed kernel redefine KBUILD_CFLAGS, dropping this flag. Add the flag to the Makefile for the compressed kernel, as well as the EFI stub Makefile to fix this. Also add the flag to boot/Makefile and realmode/rm/Makefile so that the kernel's boot code (boot/setup.elf) and realmode trampoline (realmode/rm/realmode.elf) won't be compiled with .eh_frame sections, since their linker scripts also just discard them. [1] https://lore.kernel.org/lkml/20200222185806.ywnqhfqmy67akfsa@google.com/ Suggested-by: Fangrui Song Signed-off-by: Arvind Sankar Signed-off-by: Borislav Petkov Reviewed-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Reviewed-by: Kees Cook Tested-by: Nathan Chancellor Link: https://lkml.kernel.org/r/20200224232129.597160-2-nivedita@alum.mit.edu --- arch/x86/boot/Makefile | 1 + arch/x86/boot/compressed/Makefile | 1 + arch/x86/realmode/rm/Makefile | 1 + drivers/firmware/efi/libstub/Makefile | 3 ++- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile index 012b82f..24f011e 100644 --- a/arch/x86/boot/Makefile +++ b/arch/x86/boot/Makefile @@ -68,6 +68,7 @@ clean-files += cpustr.h KBUILD_CFLAGS := $(REALMODE_CFLAGS) -D_SETUP KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=) +KBUILD_CFLAGS += -fno-asynchronous-unwind-tables GCOV_PROFILE := n UBSAN_SANITIZE := n diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile index 26050ae..c331113 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile @@ -39,6 +39,7 @@ KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) KBUILD_CFLAGS += $(call cc-disable-warning, gnu) KBUILD_CFLAGS += -Wno-pointer-sign KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=) +KBUILD_CFLAGS += -fno-asynchronous-unwind-tables KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ GCOV_PROFILE := n diff --git a/arch/x86/realmode/rm/Makefile b/arch/x86/realmode/rm/Makefile index 99b6332..b11ec5d 100644 --- a/arch/x86/realmode/rm/Makefile +++ b/arch/x86/realmode/rm/Makefile @@ -71,5 +71,6 @@ $(obj)/realmode.relocs: $(obj)/realmode.elf FORCE KBUILD_CFLAGS := $(REALMODE_CFLAGS) -D_SETUP -D_WAKEUP \ -I$(srctree)/arch/x86/boot KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ +KBUILD_CFLAGS += -fno-asynchronous-unwind-tables GCOV_PROFILE := n UBSAN_SANITIZE := n diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile index 98a8157..a1140c4 100644 --- a/drivers/firmware/efi/libstub/Makefile +++ b/drivers/firmware/efi/libstub/Makefile @@ -12,7 +12,8 @@ cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ -O2 \ -mno-mmx -mno-sse -fshort-wchar \ -Wno-pointer-sign \ $(call cc-disable-warning, address-of-packed-member) \ - $(call cc-disable-warning, gnu) + $(call cc-disable-warning, gnu) \ + -fno-asynchronous-unwind-tables # arm64 uses the full KBUILD_CFLAGS so it's necessary to explicitly # disable the stackleak plugin