]> git.baikalelectronics.ru Git - kernel.git/commit
x86/boot: Prevent faulty bootparams.screeninfo from causing harm
authorJan H. Schönherr <jschoenh@amazon.de>
Sun, 27 Aug 2017 18:23:43 +0000 (20:23 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 29 Aug 2017 11:32:50 +0000 (13:32 +0200)
commitbe318582e8a97753e4387d4e011e8cad3ebe7e3a
treefce72809a3f0b6248af9f98c0f98323163ef0b86
parent00cf57b57f9ea5e263193a0b2f43ab1d18227364
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>
arch/x86/boot/compressed/misc.c