From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27F22C64ED8 for ; Thu, 23 Feb 2023 09:50:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233681AbjBWJu3 (ORCPT ); Thu, 23 Feb 2023 04:50:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233272AbjBWJu2 (ORCPT ); Thu, 23 Feb 2023 04:50:28 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F275E4DE2E; Thu, 23 Feb 2023 01:50:26 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A7CB5B81990; Thu, 23 Feb 2023 09:50:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9D17C433EF; Thu, 23 Feb 2023 09:50:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1677145824; bh=6+RS3vKNtOBH6Iix7VuTmtdw51WghGYeiUtoXdjfsao=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pxNV593LF5ua2oXpyWhWw1CF8jqDWKRzFCBzYfUwdPB1+9vcs6TD9K2SlZipxjpQB kV9faWEzrhPUEdIgV4eq1gA6XRO9nQrFwQ5KdKWOiyXk8WAIxeNisp8BiVE0gT9p4h n5hwQSUaA3nqHXumhYz3HIspsumEAftd2BDgXNvU= Date: Thu, 23 Feb 2023 10:50:22 +0100 From: Greg Kroah-Hartman To: Tom Saeger Cc: Sasha Levin , Naresh Kamboju , John Paul Adrian Glaubitz , Rich Felker , Masahiro Yamada , Ard Biesheuvel , Nathan Chancellor , Dennis Gilmore , Palmer Dabbelt , Arnd Bergmann , Andrew Morton , stable@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, "H.J. Lu" , Borislav Petkov , Kees Cook Subject: Re: [PATCH 5.4 v2 1/6] x86, vmlinux.lds: Add RUNTIME_DISCARD_EXIT to generic DISCARDS Message-ID: References: <20230210-tsaeger-upstream-linux-stable-5-4-v2-0-a56d1e0f5e98@oracle.com> <20230210-tsaeger-upstream-linux-stable-5-4-v2-1-a56d1e0f5e98@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230210-tsaeger-upstream-linux-stable-5-4-v2-1-a56d1e0f5e98@oracle.com> Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org On Fri, Feb 10, 2023 at 01:20:22PM -0700, Tom Saeger wrote: > From: "H.J. Lu" > > commit 84d5f77fc2ee4e010c2c037750e32f06e55224b0 upstream. > > In the x86 kernel, .exit.text and .exit.data sections are discarded at > runtime, not by the linker. Add RUNTIME_DISCARD_EXIT to generic DISCARDS > and define it in the x86 kernel linker script to keep them. > > The sections are added before the DISCARD directive so document here > only the situation explicitly as this change doesn't have any effect on > the generated kernel. Also, other architectures like ARM64 will use it > too so generalize the approach with the RUNTIME_DISCARD_EXIT define. > > [ bp: Massage and extend commit message. ] > > Signed-off-by: H.J. Lu > Signed-off-by: Borislav Petkov > Reviewed-by: Kees Cook > Link: https://lkml.kernel.org/r/20200326193021.255002-1-hjl.tools@gmail.com > Signed-off-by: Tom Saeger > --- > arch/x86/kernel/vmlinux.lds.S | 1 + > include/asm-generic/vmlinux.lds.h | 11 +++++++++-- > 2 files changed, 10 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S > index 1afe211d7a7c..0ae3cd9a25ea 100644 > --- a/arch/x86/kernel/vmlinux.lds.S > +++ b/arch/x86/kernel/vmlinux.lds.S > @@ -21,6 +21,7 @@ > #define LOAD_OFFSET __START_KERNEL_map > #endif > > +#define RUNTIME_DISCARD_EXIT > #include > #include > #include Does this backport look correct from a style point-of-view? Hint, extra blank line needed after the define, like what is done in the original... thanks, greg k-h From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EDD6BC636D6 for ; Thu, 23 Feb 2023 09:50:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mB4ZtRtz0cqE/2FEyCP240dEemLX+xPKd34ho5K95Ec=; b=1H9NX4Du0kMpw/ tXg1tdUnByU847J690QTqz2SK4zT57hK31XW9tslm4gNu6EpkZBZl2fW2g2lC55jpy8gBHrHedFcM cO4parYt2ykameqdLCdOlU41YKYjmUob+VumuQp6r0ry24pYWbBp4O7zxR/cosi+OCcjTumhJ4i9a BAcubACSbHJtqWVQnETCb5Hzc0XcRoJ395IxZEkBlrijAqSDBJLcOR+4baG1ncUJ+PqIFFINKaXLb VRvDP4jVNxSBAUbvAwXywEG0RjHTUwrFpsohaHigTgSXlbR29Y6u68pKMjM5fJIdNGM2EfMTcm8u5 K75WZSPOKZ+aayAoowCw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pV8FJ-00FmM8-FO; Thu, 23 Feb 2023 09:50:37 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pV8F9-00FmK5-0T; Thu, 23 Feb 2023 09:50:28 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9238BB818F9; Thu, 23 Feb 2023 09:50:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9D17C433EF; Thu, 23 Feb 2023 09:50:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1677145824; bh=6+RS3vKNtOBH6Iix7VuTmtdw51WghGYeiUtoXdjfsao=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pxNV593LF5ua2oXpyWhWw1CF8jqDWKRzFCBzYfUwdPB1+9vcs6TD9K2SlZipxjpQB kV9faWEzrhPUEdIgV4eq1gA6XRO9nQrFwQ5KdKWOiyXk8WAIxeNisp8BiVE0gT9p4h n5hwQSUaA3nqHXumhYz3HIspsumEAftd2BDgXNvU= Date: Thu, 23 Feb 2023 10:50:22 +0100 From: Greg Kroah-Hartman To: Tom Saeger Cc: Sasha Levin , Naresh Kamboju , John Paul Adrian Glaubitz , Rich Felker , Masahiro Yamada , Ard Biesheuvel , Nathan Chancellor , Dennis Gilmore , Palmer Dabbelt , Arnd Bergmann , Andrew Morton , stable@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, "H.J. Lu" , Borislav Petkov , Kees Cook Subject: Re: [PATCH 5.4 v2 1/6] x86, vmlinux.lds: Add RUNTIME_DISCARD_EXIT to generic DISCARDS Message-ID: References: <20230210-tsaeger-upstream-linux-stable-5-4-v2-0-a56d1e0f5e98@oracle.com> <20230210-tsaeger-upstream-linux-stable-5-4-v2-1-a56d1e0f5e98@oracle.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230210-tsaeger-upstream-linux-stable-5-4-v2-1-a56d1e0f5e98@oracle.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230223_015027_221202_E2B1EFE5 X-CRM114-Status: GOOD ( 20.17 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Fri, Feb 10, 2023 at 01:20:22PM -0700, Tom Saeger wrote: > From: "H.J. Lu" > > commit 84d5f77fc2ee4e010c2c037750e32f06e55224b0 upstream. > > In the x86 kernel, .exit.text and .exit.data sections are discarded at > runtime, not by the linker. Add RUNTIME_DISCARD_EXIT to generic DISCARDS > and define it in the x86 kernel linker script to keep them. > > The sections are added before the DISCARD directive so document here > only the situation explicitly as this change doesn't have any effect on > the generated kernel. Also, other architectures like ARM64 will use it > too so generalize the approach with the RUNTIME_DISCARD_EXIT define. > > [ bp: Massage and extend commit message. ] > > Signed-off-by: H.J. Lu > Signed-off-by: Borislav Petkov > Reviewed-by: Kees Cook > Link: https://lkml.kernel.org/r/20200326193021.255002-1-hjl.tools@gmail.com > Signed-off-by: Tom Saeger > --- > arch/x86/kernel/vmlinux.lds.S | 1 + > include/asm-generic/vmlinux.lds.h | 11 +++++++++-- > 2 files changed, 10 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S > index 1afe211d7a7c..0ae3cd9a25ea 100644 > --- a/arch/x86/kernel/vmlinux.lds.S > +++ b/arch/x86/kernel/vmlinux.lds.S > @@ -21,6 +21,7 @@ > #define LOAD_OFFSET __START_KERNEL_map > #endif > > +#define RUNTIME_DISCARD_EXIT > #include > #include > #include Does this backport look correct from a style point-of-view? Hint, extra blank line needed after the define, like what is done in the original... thanks, greg k-h _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B9E8DC61DA4 for ; Thu, 23 Feb 2023 09:51:25 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4PMpFR6hHSz3cXl for ; Thu, 23 Feb 2023 20:51:23 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=pxNV593L; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linuxfoundation.org (client-ip=145.40.68.75; helo=ams.source.kernel.org; envelope-from=gregkh@linuxfoundation.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=pxNV593L; dkim-atps=neutral Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4PMpDP4tpxz3bbS for ; Thu, 23 Feb 2023 20:50:29 +1100 (AEDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9238BB818F9; Thu, 23 Feb 2023 09:50:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9D17C433EF; Thu, 23 Feb 2023 09:50:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1677145824; bh=6+RS3vKNtOBH6Iix7VuTmtdw51WghGYeiUtoXdjfsao=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pxNV593LF5ua2oXpyWhWw1CF8jqDWKRzFCBzYfUwdPB1+9vcs6TD9K2SlZipxjpQB kV9faWEzrhPUEdIgV4eq1gA6XRO9nQrFwQ5KdKWOiyXk8WAIxeNisp8BiVE0gT9p4h n5hwQSUaA3nqHXumhYz3HIspsumEAftd2BDgXNvU= Date: Thu, 23 Feb 2023 10:50:22 +0100 From: Greg Kroah-Hartman To: Tom Saeger Subject: Re: [PATCH 5.4 v2 1/6] x86, vmlinux.lds: Add RUNTIME_DISCARD_EXIT to generic DISCARDS Message-ID: References: <20230210-tsaeger-upstream-linux-stable-5-4-v2-0-a56d1e0f5e98@oracle.com> <20230210-tsaeger-upstream-linux-stable-5-4-v2-1-a56d1e0f5e98@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230210-tsaeger-upstream-linux-stable-5-4-v2-1-a56d1e0f5e98@oracle.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rich Felker , linux-sh@vger.kernel.org, Palmer Dabbelt , linux-riscv@lists.infradead.org, Ard Biesheuvel , Sasha Levin , linux-s390@vger.kernel.org, Dennis Gilmore , Naresh Kamboju , Borislav Petkov , linux-arch@vger.kernel.org, Kees Cook , Arnd Bergmann , "H.J. Lu" , Nathan Chancellor , John Paul Adrian Glaubitz , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Andrew Morton , linuxppc-dev@lists.ozlabs.org, Masahiro Yamada Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, Feb 10, 2023 at 01:20:22PM -0700, Tom Saeger wrote: > From: "H.J. Lu" > > commit 84d5f77fc2ee4e010c2c037750e32f06e55224b0 upstream. > > In the x86 kernel, .exit.text and .exit.data sections are discarded at > runtime, not by the linker. Add RUNTIME_DISCARD_EXIT to generic DISCARDS > and define it in the x86 kernel linker script to keep them. > > The sections are added before the DISCARD directive so document here > only the situation explicitly as this change doesn't have any effect on > the generated kernel. Also, other architectures like ARM64 will use it > too so generalize the approach with the RUNTIME_DISCARD_EXIT define. > > [ bp: Massage and extend commit message. ] > > Signed-off-by: H.J. Lu > Signed-off-by: Borislav Petkov > Reviewed-by: Kees Cook > Link: https://lkml.kernel.org/r/20200326193021.255002-1-hjl.tools@gmail.com > Signed-off-by: Tom Saeger > --- > arch/x86/kernel/vmlinux.lds.S | 1 + > include/asm-generic/vmlinux.lds.h | 11 +++++++++-- > 2 files changed, 10 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S > index 1afe211d7a7c..0ae3cd9a25ea 100644 > --- a/arch/x86/kernel/vmlinux.lds.S > +++ b/arch/x86/kernel/vmlinux.lds.S > @@ -21,6 +21,7 @@ > #define LOAD_OFFSET __START_KERNEL_map > #endif > > +#define RUNTIME_DISCARD_EXIT > #include > #include > #include Does this backport look correct from a style point-of-view? Hint, extra blank line needed after the define, like what is done in the original... thanks, greg k-h From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8C207C636D6 for ; Thu, 23 Feb 2023 09:51:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3v2spzYMFT7yd/VCoeocgXja3dG51FuLpmbDIM6GuPo=; b=ufoqNdVKfDQAXU uRwBbEEWgNHDljzrr/ke1b5emDZqjZpOCRt1BpV1nmHE6iOHOZ5VlEC4w0xlkeNlHJ9KbsRxUACqf CbWueWbwyFABq1gC0sqDcuMhovhx/4Pf7e7arL0nxOM7nORm07XmjfFEExonXaM2nx0+HrQV0jQa1 QQJ/uLGVxC1SLWuFpvTa1jrDCiOvJHp6M/ZRr4y6VLGakFS8PhF9xLN5C5n82uX0OhDHxHDHcE3/2 162cnR4nWZ1202+vO9/Gg26Q8cEBxgv/J+tvbhvTq7qgaKVFovSi43H44jcsLK/fREd7jFcpw+szV /+a36tpjiiIlewlCCKQw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pV8FC-00FmKi-Cb; Thu, 23 Feb 2023 09:50:30 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pV8F9-00FmK5-0T; Thu, 23 Feb 2023 09:50:28 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9238BB818F9; Thu, 23 Feb 2023 09:50:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9D17C433EF; Thu, 23 Feb 2023 09:50:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1677145824; bh=6+RS3vKNtOBH6Iix7VuTmtdw51WghGYeiUtoXdjfsao=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pxNV593LF5ua2oXpyWhWw1CF8jqDWKRzFCBzYfUwdPB1+9vcs6TD9K2SlZipxjpQB kV9faWEzrhPUEdIgV4eq1gA6XRO9nQrFwQ5KdKWOiyXk8WAIxeNisp8BiVE0gT9p4h n5hwQSUaA3nqHXumhYz3HIspsumEAftd2BDgXNvU= Date: Thu, 23 Feb 2023 10:50:22 +0100 From: Greg Kroah-Hartman To: Tom Saeger Cc: Sasha Levin , Naresh Kamboju , John Paul Adrian Glaubitz , Rich Felker , Masahiro Yamada , Ard Biesheuvel , Nathan Chancellor , Dennis Gilmore , Palmer Dabbelt , Arnd Bergmann , Andrew Morton , stable@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, "H.J. Lu" , Borislav Petkov , Kees Cook Subject: Re: [PATCH 5.4 v2 1/6] x86, vmlinux.lds: Add RUNTIME_DISCARD_EXIT to generic DISCARDS Message-ID: References: <20230210-tsaeger-upstream-linux-stable-5-4-v2-0-a56d1e0f5e98@oracle.com> <20230210-tsaeger-upstream-linux-stable-5-4-v2-1-a56d1e0f5e98@oracle.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230210-tsaeger-upstream-linux-stable-5-4-v2-1-a56d1e0f5e98@oracle.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230223_015027_221202_E2B1EFE5 X-CRM114-Status: GOOD ( 20.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Feb 10, 2023 at 01:20:22PM -0700, Tom Saeger wrote: > From: "H.J. Lu" > > commit 84d5f77fc2ee4e010c2c037750e32f06e55224b0 upstream. > > In the x86 kernel, .exit.text and .exit.data sections are discarded at > runtime, not by the linker. Add RUNTIME_DISCARD_EXIT to generic DISCARDS > and define it in the x86 kernel linker script to keep them. > > The sections are added before the DISCARD directive so document here > only the situation explicitly as this change doesn't have any effect on > the generated kernel. Also, other architectures like ARM64 will use it > too so generalize the approach with the RUNTIME_DISCARD_EXIT define. > > [ bp: Massage and extend commit message. ] > > Signed-off-by: H.J. Lu > Signed-off-by: Borislav Petkov > Reviewed-by: Kees Cook > Link: https://lkml.kernel.org/r/20200326193021.255002-1-hjl.tools@gmail.com > Signed-off-by: Tom Saeger > --- > arch/x86/kernel/vmlinux.lds.S | 1 + > include/asm-generic/vmlinux.lds.h | 11 +++++++++-- > 2 files changed, 10 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S > index 1afe211d7a7c..0ae3cd9a25ea 100644 > --- a/arch/x86/kernel/vmlinux.lds.S > +++ b/arch/x86/kernel/vmlinux.lds.S > @@ -21,6 +21,7 @@ > #define LOAD_OFFSET __START_KERNEL_map > #endif > > +#define RUNTIME_DISCARD_EXIT > #include > #include > #include Does this backport look correct from a style point-of-view? Hint, extra blank line needed after the define, like what is done in the original... thanks, greg k-h _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel