lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 14 Mar 2023 13:13:28 +0300
From:   Evgeniy Baskov <baskov@...ras.ru>
To:     Ard Biesheuvel <ardb@...nel.org>
Cc:     Evgeniy Baskov <baskov@...ras.ru>, Borislav Petkov <bp@...en8.de>,
        Andy Lutomirski <luto@...nel.org>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Alexey Khoroshilov <khoroshilov@...ras.ru>,
        Peter Jones <pjones@...hat.com>,
        Gerd Hoffmann <kraxel@...hat.com>,
        "Limonciello, Mario" <mario.limonciello@....com>,
        joeyli <jlee@...e.com>, lvc-project@...uxtesting.org,
        x86@...nel.org, linux-efi@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: [PATCH v5 01/27] x86/boot: Align vmlinuz sections on page size

To protect sections on page table level each section needs to be
aligned on page size (4KB).

Set sections alignment in linker script for the kernel decompressor
(boot/compressed/vmlinux.lds.S).

Also introduce symbols that can be used to reference compressed
kernel blob section later in the later patches.

Tested-by: Mario Limonciello <mario.limonciello@....com>
Signed-off-by: Evgeniy Baskov <baskov@...ras.ru>
---
 arch/x86/boot/compressed/vmlinux.lds.S | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/x86/boot/compressed/vmlinux.lds.S b/arch/x86/boot/compressed/vmlinux.lds.S
index b22f34b8684a..a5015b958085 100644
--- a/arch/x86/boot/compressed/vmlinux.lds.S
+++ b/arch/x86/boot/compressed/vmlinux.lds.S
@@ -27,31 +27,32 @@ SECTIONS
 		HEAD_TEXT
 		_ehead = . ;
 	}
-	.rodata..compressed : {
+	.rodata..compressed : ALIGN(PAGE_SIZE) {
+		_compressed = .;
 		*(.rodata..compressed)
+		_ecompressed = .;
 	}
-	.text :	{
+	.text :	ALIGN(PAGE_SIZE) {
 		_text = .; 	/* Text */
 		*(.text)
 		*(.text.*)
 		*(.noinstr.text)
 		_etext = . ;
 	}
-	.rodata : {
+	.rodata : ALIGN(PAGE_SIZE) {
 		_rodata = . ;
 		*(.rodata)	 /* read-only data */
 		*(.rodata.*)
 		_erodata = . ;
 	}
-	.data :	{
+	.data :	ALIGN(PAGE_SIZE) {
 		_data = . ;
 		*(.data)
 		*(.data.*)
 		*(.bss.efistub)
 		_edata = . ;
 	}
-	. = ALIGN(L1_CACHE_BYTES);
-	.bss : {
+	.bss : ALIGN(L1_CACHE_BYTES) {
 		_bss = . ;
 		*(.bss)
 		*(.bss.*)
@@ -60,8 +61,7 @@ SECTIONS
 		_ebss = .;
 	}
 #ifdef CONFIG_X86_64
-       . = ALIGN(PAGE_SIZE);
-       .pgtable : {
+       .pgtable : ALIGN(PAGE_SIZE) {
 		_pgtable = . ;
 		*(.pgtable)
 		_epgtable = . ;
-- 
2.39.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ