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>] [day] [month] [year] [list]
Message-Id: <20220328183526.435-1-harmsmitsdev@gmail.com>
Date:   Mon, 28 Mar 2022 20:35:24 +0200
From:   harm-smits <harmsmitsdev@...il.com>
To:     unlisted-recipients:; (no To-header on input)
Cc:     harmsmitsdev@...il.com, Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
        "H. Peter Anvin" <hpa@...or.com>,
        Brijesh Singh <brijesh.singh@....com>,
        Joerg Roedel <jroedel@...e.de>,
        Tom Lendacky <thomas.lendacky@....com>,
        Marco Bonelli <marco@...eim.net>, linux-kernel@...r.kernel.org
Subject: [PATCH] x86/head/64: Codestyle fixes for loading startup GDT

Wrap the GDT access in `fixup_pointer` to avoid having to rely on the
compiler optimization passes to generate %rip relative access. This also
brings it in line with the rest of the code that is executed before the
virtual paging is loaded (e.g. `__startup_64` and
`startup_64_load_idt`).

Signed-off-by: harm-smits <harmsmitsdev@...il.com>
---
 arch/x86/kernel/head64.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index 4f5ecbbaae77..33360a1b6ffc 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -613,8 +613,9 @@ void early_setup_idt(void)
 void __head startup_64_setup_env(unsigned long physbase)
 {
 	/* Load GDT */
-	startup_gdt_descr.address = (unsigned long)fixup_pointer(startup_gdt, physbase);
-	native_load_gdt(&startup_gdt_descr);
+	struct desc_ptr *desc = fixup_pointer(&startup_gdt_descr, physbase);
+	desc->address = (unsigned long)fixup_pointer(startup_gdt, physbase);
+	native_load_gdt(desc);
 
 	/* New GDT is live - reload data segment registers */
 	asm volatile("movl %%eax, %%ds\n"
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ