From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S970101AbdDTLXG (ORCPT ); Thu, 20 Apr 2017 07:23:06 -0400 Received: from terminus.zytor.com ([65.50.211.136]:59653 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965892AbdDTLXA (ORCPT ); Thu, 20 Apr 2017 07:23:00 -0400 Date: Thu, 20 Apr 2017 04:16:18 -0700 From: tip-bot for Ashish Kalra Message-ID: Cc: ashish@bluestacks.com, stable@vger.kernel.org, peterz@infradead.org, jpoimboe@redhat.com, linux-kernel@vger.kernel.org, brgerst@gmail.com, tglx@linutronix.de, bp@alien8.de, luto@kernel.org, hpa@zytor.com, dvlasenk@redhat.com, mingo@kernel.org, torvalds@linux-foundation.org Reply-To: ashish@bluestacks.com, stable@vger.kernel.org, peterz@infradead.org, jpoimboe@redhat.com, linux-kernel@vger.kernel.org, brgerst@gmail.com, tglx@linutronix.de, bp@alien8.de, luto@kernel.org, dvlasenk@redhat.com, hpa@zytor.com, mingo@kernel.org, torvalds@linux-foundation.org In-Reply-To: <20170419152015.10011-1-ashishkalra@Ashishs-MacBook-Pro.local> References: <20170419152015.10011-1-ashishkalra@Ashishs-MacBook-Pro.local> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/boot] x86/boot: Fix BSS corruption/overwrite bug in early x86 kernel startup Git-Commit-ID: d594aa0277e541bb997aef0bc0a55172d8138340 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: d594aa0277e541bb997aef0bc0a55172d8138340 Gitweb: http://git.kernel.org/tip/d594aa0277e541bb997aef0bc0a55172d8138340 Author: Ashish Kalra AuthorDate: Wed, 19 Apr 2017 20:50:15 +0530 Committer: Ingo Molnar CommitDate: Thu, 20 Apr 2017 10:05:23 +0200 x86/boot: Fix BSS corruption/overwrite bug in early x86 kernel startup 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 Cc: Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Josh Poimboeuf Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20170419152015.10011-1-ashishkalra@Ashishs-MacBook-Pro.local Signed-off-by: Ingo Molnar --- arch/x86/boot/boot.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h index 9b42b6d..ef5a9cc 100644 --- a/arch/x86/boot/boot.h +++ b/arch/x86/boot/boot.h @@ -16,7 +16,7 @@ #ifndef BOOT_BOOT_H #define BOOT_BOOT_H -#define STACK_SIZE 512 /* Minimum number of bytes for stack */ +#define STACK_SIZE 1024 /* Minimum number of bytes for stack */ #ifndef __ASSEMBLY__