]> asedeno.scripts.mit.edu Git - linux.git/commit
vt: avoid a VLA in the unicode screen scroll function
authorNicolas Pitre <nicolas.pitre@linaro.org>
Thu, 19 Jul 2018 04:05:25 +0000 (00:05 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 21 Jul 2018 07:19:46 +0000 (09:19 +0200)
commitd541ae4e76ae35b76490206ef946a9124b993e32
tree5c04d74c91af1d1a312030921042f433a7e8942a
parent13aa0a12183f804d95c4c5c4d09df19ea74eb424
vt: avoid a VLA in the unicode screen scroll function

The nr argument is typically small: most often nr == 1. However this
could be abused with a very large explicit scroll in a resized screen.
Make the code scroll lines by performing an array rotation operation to
avoid the need for a large temporary space.

Requested-by: Kees Cook <keescook@chromium.org>
Suggested-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/vt/vt.c