summaryrefslogtreecommitdiffstats
path: root/drivers/tty/vt
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2018-10-04 11:03:34 +1000
committerDave Airlie <airlied@redhat.com>2018-10-04 11:03:34 +1000
commit6004f172b375f5747e89afc62ad3baaf1bebd58a (patch)
tree914fafcc0e373c45c6e0dcc3661dad3a8be5f3d1 /drivers/tty/vt
parent612c6bd5e3f8b67505316805dc15369598f6ff57 (diff)
parent17b57b1883c1285f3d0dc2266e8f79286a7bef38 (diff)
downloadblackbird-op-linux-6004f172b375f5747e89afc62ad3baaf1bebd58a.tar.gz
blackbird-op-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);
OpenPOWER on IntegriCloud