x86/boot: Prevent faulty bootparams.screeninfo from causing harm

If a zero for the number of lines manages to slip through, scroll()
may underflow some offset calculations, causing accesses outside the
video memory.

Make the check in __putstr() more pessimistic to prevent that.

Signed-off-by: Jan H. Schönherr <jschoenh@amazon.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Kees Cook <keescook@chromium.org>
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/1503858223-14983-1-git-send-email-jschoenh@amazon.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by Jan H. Schönherr and committed by Ingo Molnar fb1cc2f9 5746f055

Changed files
+1 -2
arch
x86
boot
compressed
+1 -2
arch/x86/boot/compressed/misc.c
··· 116 116 } 117 117 } 118 118 119 - if (boot_params->screen_info.orig_video_mode == 0 && 120 - lines == 0 && cols == 0) 119 + if (lines == 0 || cols == 0) 121 120 return; 122 121 123 122 x = boot_params->screen_info.orig_x;