summaryrefslogtreecommitdiffstats
path: root/drivers/tty/vt
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2018-10-04 03:03:34 +0200
committerDave Airlie <airlied@redhat.com>2018-10-04 03:03:34 +0200
commit6004f172b375f5747e89afc62ad3baaf1bebd58a (patch)
tree914fafcc0e373c45c6e0dcc3661dad3a8be5f3d1 /drivers/tty/vt
parentMerge tag 'exynos-drm-next-for-v4.20' of git://git.kernel.org/pub/scm/linux/k... (diff)
parentLinux 4.19-rc6 (diff)
downloadlinux-6004f172b375f5747e89afc62ad3baaf1bebd58a.tar.xz
linux-6004f172b375f5747e89afc62ad3baaf1bebd58a.zip
BackMerge v4.19-rc6 into drm-next
I have some pulls based on rc6, and I prefer to have an explicit backmerge. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/tty/vt')
-rw-r--r--drivers/tty/vt/vt_ioctl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/tty/vt/vt_ioctl.c b/drivers/tty/vt/vt_ioctl.c
index a78ad10a119b..73cdc0d633dd 100644
--- a/drivers/tty/vt/vt_ioctl.c
+++ b/drivers/tty/vt/vt_ioctl.c
@@ -32,6 +32,8 @@
#include <asm/io.h>
#include <linux/uaccess.h>
+#include <linux/nospec.h>
+
#include <linux/kbd_kern.h>
#include <linux/vt_kern.h>
#include <linux/kbd_diacr.h>
@@ -700,6 +702,8 @@ int vt_ioctl(struct tty_struct *tty,
if (vsa.console == 0 || vsa.console > MAX_NR_CONSOLES)
ret = -ENXIO;
else {
+ vsa.console = array_index_nospec(vsa.console,
+ MAX_NR_CONSOLES + 1);
vsa.console--;
console_lock();
ret = vc_allocate(vsa.console);