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: <20190919133944.GB2507@uranus.lan>
Date:   Thu, 19 Sep 2019 16:39:44 +0300
From:   Cyrill Gorcunov <gorcunov@...il.com>
To:     LKML <linux-kernel@...r.kernel.org>
Cc:     Ingo Molnar <mingo@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>
Subject: [PATCH -tip] x86/boot: Reserve enough space for any cpu level string

Currently when we're validating cpu on boot stage we assume that cpu level
won't ever be greater than two digits. In particular the check_cpu() helper
ensures to be so. Still the cpu_name() helper is a way too far from
check_cpu() routine internals so I think better to be on a safe side
and prevent any possible overrun errors when printing cpu name.
For this sake just increase the buffer up to be able to keep any level.

CC: Ingo Molnar <mingo@...nel.org>
CC: Thomas Gleixner <tglx@...utronix.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@...il.com>
---
 arch/x86/boot/cpu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-tip.git/arch/x86/boot/cpu.c
===================================================================
--- linux-tip.git.orig/arch/x86/boot/cpu.c
+++ linux-tip.git/arch/x86/boot/cpu.c
@@ -20,7 +20,7 @@
 
 static char *cpu_name(int level)
 {
-	static char buf[6];
+	static char buf[16];
 
 	if (level == 64) {
 		return "x86-64";

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ