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-next>] [day] [month] [year] [list]
Message-Id: <1557208860-12846-1-git-send-email-kernelfans@gmail.com>
Date:   Tue,  7 May 2019 14:00:59 +0800
From:   Pingfan Liu <kernelfans@...il.com>
To:     x86@...nel.org
Cc:     Pingfan Liu <kernelfans@...il.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        "H. Peter Anvin" <hpa@...or.com>,
        Jordan Borgner <mail@...dan-borgner.de>,
        linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] x86/boot: move early_serial_base to .data section

arch/x86/boot/compressed/head_64.S clears BSS after relocated. If early
serial is set up before clearing BSS, the early_serial_base will be reset
to 0.

Initializing early_serial_base as -1 to push it to .data section.

Signed-off-by: Pingfan Liu <kernelfans@...il.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: Borislav Petkov <bp@...en8.de>
Cc: "H. Peter Anvin" <hpa@...or.com>
Cc: Jordan Borgner <mail@...dan-borgner.de>
Cc: linux-kernel@...r.kernel.org
---
 arch/x86/boot/compressed/early_serial_console.c | 2 +-
 arch/x86/boot/early_serial_console.c            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/boot/compressed/early_serial_console.c b/arch/x86/boot/compressed/early_serial_console.c
index 261e81f..624e334 100644
--- a/arch/x86/boot/compressed/early_serial_console.c
+++ b/arch/x86/boot/compressed/early_serial_console.c
@@ -1,5 +1,5 @@
 #include "misc.h"
 
-int early_serial_base;
+int early_serial_base = -1;
 
 #include "../early_serial_console.c"
diff --git a/arch/x86/boot/early_serial_console.c b/arch/x86/boot/early_serial_console.c
index 023bf1c..d8de15a 100644
--- a/arch/x86/boot/early_serial_console.c
+++ b/arch/x86/boot/early_serial_console.c
@@ -149,6 +149,6 @@ void console_init(void)
 {
 	parse_earlyprintk();
 
-	if (!early_serial_base)
+	if (early_serial_base <= 0)
 		parse_console_uart8250();
 }
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ