]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
x86/boot: Fix BSS corruption/overwrite bug in early x86 kernel startup
authorAshish Kalra <ashish@bluestacks.com>
Wed, 19 Apr 2017 15:20:15 +0000 (20:50 +0530)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 20 Jun 2017 08:50:18 +0000 (10:50 +0200)
commit6696ee9e38ebca8aa919421f808e50e283306cf0
tree072c641bc47a3e759aeb9aa9d6175f29f501228b
parent9e5b340e3d9fdeab1347e9fd59d48a979cd70c5a
x86/boot: Fix BSS corruption/overwrite bug in early x86 kernel startup

BugLink: http://bugs.launchpad.net/bugs/1692898
commit d594aa0277e541bb997aef0bc0a55172d8138340 upstream.

The minimum size for a new stack (512 bytes) setup for arch/x86/boot components
when the bootloader does not setup/provide a stack for the early boot components
is not "enough".

The setup code executing as part of early kernel startup code, uses the stack
beyond 512 bytes and accidentally overwrites and corrupts part of the BSS
section. This is exposed mostly in the early video setup code, where
it was corrupting BSS variables like force_x, force_y, which in-turn affected
kernel parameters such as screen_info (screen_info.orig_video_cols) and
later caused an exception/panic in console_init().

Most recent boot loaders setup the stack for early boot components, so this
stack overwriting into BSS section issue has not been exposed.

Signed-off-by: Ashish Kalra <ashish@bluestacks.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20170419152015.10011-1-ashishkalra@Ashishs-MacBook-Pro.local
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
arch/x86/boot/boot.h