From mboxrd@z Thu Jan 1 00:00:00 1970 From: "tip-bot2 for Kees Cook" Subject: [tip: x86/build] x86/vmlinux: Restore "text" Program Header with dummy section Date: Tue, 05 Nov 2019 09:27:34 -0000 Message-ID: <157294605427.29376.6840275918846059638.tip-bot2@tip-bot2> References: <20191029211351.13243-8-keescook@chromium.org> Reply-To: linux-kernel@vger.kernel.org Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20191029211351.13243-8-keescook@chromium.org> Sender: linux-kernel-owner@vger.kernel.org To: linux-tip-commits@vger.kernel.org Cc: Kees Cook , Borislav Petkov , Andy Lutomirski , Arnd Bergmann , Dave Hansen , linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-ia64@vger.kernel.org, linux-s390@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Michael Ellerman , Michal Simek , Rick Edgecombe , Segher Boessenkool , Will Deacon , Yoshinori Sato , x86-ml , Ingo Molnar , Borislav Petkov , linux-kernel@vger.kernel.org List-Id: linux-arch.vger.kernel.org The following commit has been merged into the x86/build branch of tip: Commit-ID: 7a42d41d9dc2829bdf589db855ce3f948de2da6b Gitweb: https://git.kernel.org/tip/7a42d41d9dc2829bdf589db855ce3f948de2da6b Author: Kees Cook AuthorDate: Tue, 29 Oct 2019 14:13:29 -07:00 Committer: Borislav Petkov CommitterDate: Mon, 04 Nov 2019 15:34:36 +01:00 x86/vmlinux: Restore "text" Program Header with dummy section In a linker script, if one places a section in one or more segments using ":PHDR", then the linker will place all subsequent allocatable sections, which do not specify ":PHDR", into the same segments. In order to have the NOTES section in both PT_LOAD (":text") and PT_NOTE (":note"), both segments are marked, and the only way to undo this to keep subsequent sections out of PT_NOTE is to mark the following section with just the single desired PT_LOAD (":text"). In preparation for having a common NOTES macro, perform the segment assignment using a dummy section (as done by other architectures). Signed-off-by: Kees Cook Signed-off-by: Borislav Petkov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Dave Hansen Cc: linux-alpha@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-c6x-dev@linux-c6x.org Cc: linux-ia64@vger.kernel.org Cc: linux-s390@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: Michael Ellerman Cc: Michal Simek Cc: Rick Edgecombe Cc: Segher Boessenkool Cc: Will Deacon Cc: Yoshinori Sato Cc: x86-ml Link: https://lkml.kernel.org/r/20191029211351.13243-8-keescook@chromium.org --- arch/x86/kernel/vmlinux.lds.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index e2feacf..788e789 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -147,8 +147,9 @@ SECTIONS } :text = 0x9090 NOTES :text :note + .dummy : { *(.dummy) } :text - EXCEPTION_TABLE(16) :text = 0x9090 + EXCEPTION_TABLE(16) /* .text should occupy whole number of pages */ . = ALIGN(PAGE_SIZE); From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from Galois.linutronix.de ([193.142.43.55]:40601 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730670AbfKEJ2F (ORCPT ); Tue, 5 Nov 2019 04:28:05 -0500 Date: Tue, 05 Nov 2019 09:27:34 -0000 From: "tip-bot2 for Kees Cook" Reply-to: linux-kernel@vger.kernel.org Subject: [tip: x86/build] x86/vmlinux: Restore "text" Program Header with dummy section In-Reply-To: <20191029211351.13243-8-keescook@chromium.org> References: <20191029211351.13243-8-keescook@chromium.org> MIME-Version: 1.0 Message-ID: <157294605427.29376.6840275918846059638.tip-bot2@tip-bot2> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: linux-tip-commits@vger.kernel.org Cc: Kees Cook , Borislav Petkov , Andy Lutomirski , Arnd Bergmann , Dave Hansen , linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-ia64@vger.kernel.org, linux-s390@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Michael Ellerman , Michal Simek , Rick Edgecombe , Segher Boessenkool , Will Deacon , Yoshinori Sato , x86-ml , Ingo Molnar , Borislav Petkov , linux-kernel@vger.kernel.org Message-ID: <20191105092734.kbx9scX8PIJ0Zc2PfyghNF2VIQVmH4nTOET_8PgpjU8@z> The following commit has been merged into the x86/build branch of tip: Commit-ID: 7a42d41d9dc2829bdf589db855ce3f948de2da6b Gitweb: https://git.kernel.org/tip/7a42d41d9dc2829bdf589db855ce3f948de2da6b Author: Kees Cook AuthorDate: Tue, 29 Oct 2019 14:13:29 -07:00 Committer: Borislav Petkov CommitterDate: Mon, 04 Nov 2019 15:34:36 +01:00 x86/vmlinux: Restore "text" Program Header with dummy section In a linker script, if one places a section in one or more segments using ":PHDR", then the linker will place all subsequent allocatable sections, which do not specify ":PHDR", into the same segments. In order to have the NOTES section in both PT_LOAD (":text") and PT_NOTE (":note"), both segments are marked, and the only way to undo this to keep subsequent sections out of PT_NOTE is to mark the following section with just the single desired PT_LOAD (":text"). In preparation for having a common NOTES macro, perform the segment assignment using a dummy section (as done by other architectures). Signed-off-by: Kees Cook Signed-off-by: Borislav Petkov Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Dave Hansen Cc: linux-alpha@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-c6x-dev@linux-c6x.org Cc: linux-ia64@vger.kernel.org Cc: linux-s390@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: Michael Ellerman Cc: Michal Simek Cc: Rick Edgecombe Cc: Segher Boessenkool Cc: Will Deacon Cc: Yoshinori Sato Cc: x86-ml Link: https://lkml.kernel.org/r/20191029211351.13243-8-keescook@chromium.org --- arch/x86/kernel/vmlinux.lds.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index e2feacf..788e789 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -147,8 +147,9 @@ SECTIONS } :text = 0x9090 NOTES :text :note + .dummy : { *(.dummy) } :text - EXCEPTION_TABLE(16) :text = 0x9090 + EXCEPTION_TABLE(16) /* .text should occupy whole number of pages */ . = ALIGN(PAGE_SIZE);