Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp544507pxb; Wed, 3 Mar 2021 09:14:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxbBGXSQ+sMtLDi4ikfb8LHI49/zM13SlKxkjkhsVHLBJUtZdf3/UZe8/aISiqWTftoa79F X-Received: by 2002:a05:6402:499:: with SMTP id k25mr302542edv.294.1614791649465; Wed, 03 Mar 2021 09:14:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614791649; cv=none; d=google.com; s=arc-20160816; b=Yyt+dYrpp71MyCs5sL0PeyYcdNDzpt8/E20OOPO1yV1WzGvBVYycxXX/flAi6WR3q5 oCHO5M0YQIjUsMvnJLzTgVMvpUMd5BeXHf6KYBgYJrbXBNKdWI+WHSqKr7BcVB8xN1R+ v/W1ecCPQRrUujsiTxcrOY6oZ+SfwegqYtAoPp33EpRQ3J+8qm7xlt90BYleangD1eL6 w8mz1IKfaKiog018rWDsbewIiE0Mi/AZHwf+995CLIERUCjKvGCJZGRkmmTQuFOIyb5r V/PJiv8KchJCEZ18o8NuP8Su7EoFJQy2PmgEsBiFtDJ/J6/GnmQdKaYQPrBA50GJcxgl JULQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=48m2Q9lvTC50wBP4oNJhLuR2tBh6FHvgd79YJUCH8Mw=; b=WIiFDnCUeuyOelr+sps53yM8nco/HXCfbWYki0NUwbNbzfTPEWTExFHjxxljwDfqLh DCxW9W57nXiL4bjObeYgBY+zjy0uKsmX4HcLm3fud0r7Re0LnWXzNnGKjpMRXyAogXa/ OqVDZtLaHbNOS5NyvWSHRcfilTXChLGD7AQLmWDYE30KLb7XxBauyQJxQdZN4zOoOljf rAPNSvWVn9R975jkQRcIBXhjFtc0W2VtZNHRZ/DoWTFTpz5bNrKEI0CIn7lTxG/1J2P5 Qz/1EXnq56gBsHK60PJ9A63A5C43sNU8TDtQoZz/Aq62LsWCYuyP3xpIKcRhyQs17X9y l0Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GQCoXxja; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id yj16si1965660ejb.413.2021.03.03.09.13.32; Wed, 03 Mar 2021 09:14:09 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=GQCoXxja; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346357AbhCBAlg (ORCPT + 99 others); Mon, 1 Mar 2021 19:41:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:47658 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239978AbhCASgO (ORCPT ); Mon, 1 Mar 2021 13:36:14 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D41A465195; Mon, 1 Mar 2021 17:11:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614618683; bh=/PPzW02UOMuKrTS27AFKolO34jLr6kzefiL5QelMfbc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GQCoXxjaMl62QXMnqpQPGHKzw/ZFCBet4f4TDIj8U+sFq0wp2xZzbNvERj7my+d1B kVeRfkmF9xY75RSAGEMcXVA0V2y4vS9qW2Ki0QOa8bn0hqjrGRxZnE/6n46C4tbhX0 7EtFJdYNvzvMQgzhNgN5/gv9BYVcIzC+0ZLXMFqg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kees Cook , Alexander Lobakin , Nathan Chancellor , Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 5.10 179/663] MIPS: properly stop .eh_frame generation Date: Mon, 1 Mar 2021 17:07:07 +0100 Message-Id: <20210301161150.630750167@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Lobakin [ Upstream commit 894ef530012fb5078466efdfb2c15d8b2f1565cd ] Commit 866b6a89c6d1 ("MIPS: Add DWARF unwinding to assembly") added -fno-asynchronous-unwind-tables to KBUILD_CFLAGS to prevent compiler from emitting .eh_frame symbols. However, as MIPS heavily uses CFI, that's not enough. Use the approach taken for x86 (as it also uses CFI) and explicitly put CFI symbols into the .debug_frame section (except for VDSO). This allows us to drop .eh_frame from DISCARDS as it's no longer being generated. Fixes: 866b6a89c6d1 ("MIPS: Add DWARF unwinding to assembly") Suggested-by: Kees Cook Signed-off-by: Alexander Lobakin Reviewed-by: Kees Cook Reviewed-by: Nathan Chancellor Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin --- arch/mips/include/asm/asm.h | 18 ++++++++++++++++++ arch/mips/kernel/vmlinux.lds.S | 1 - 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/arch/mips/include/asm/asm.h b/arch/mips/include/asm/asm.h index 3682d1a0bb808..ea4b62ece3366 100644 --- a/arch/mips/include/asm/asm.h +++ b/arch/mips/include/asm/asm.h @@ -20,10 +20,27 @@ #include #include +#ifndef __VDSO__ +/* + * Emit CFI data in .debug_frame sections, not .eh_frame sections. + * We don't do DWARF unwinding at runtime, so only the offline DWARF + * information is useful to anyone. Note we should change this if we + * ever decide to enable DWARF unwinding at runtime. + */ +#define CFI_SECTIONS .cfi_sections .debug_frame +#else + /* + * For the vDSO, emit both runtime unwind information and debug + * symbols for the .dbg file. + */ +#define CFI_SECTIONS +#endif + /* * LEAF - declare leaf routine */ #define LEAF(symbol) \ + CFI_SECTIONS; \ .globl symbol; \ .align 2; \ .type symbol, @function; \ @@ -36,6 +53,7 @@ symbol: .frame sp, 0, ra; \ * NESTED - declare nested routine entry point */ #define NESTED(symbol, framesize, rpc) \ + CFI_SECTIONS; \ .globl symbol; \ .align 2; \ .type symbol, @function; \ diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S index 83e27a181206a..09fa4705ce8eb 100644 --- a/arch/mips/kernel/vmlinux.lds.S +++ b/arch/mips/kernel/vmlinux.lds.S @@ -224,6 +224,5 @@ SECTIONS *(.options) *(.pdr) *(.reginfo) - *(.eh_frame) } } -- 2.27.0