summaryrefslogtreecommitdiff
path: root/drivers/tty
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2018-10-12 05:30:16 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2018-10-12 05:30:16 -0700
commitbbaf766c22fc4745fbf4494037a62a21ad7c5ecc (patch)
treea0cac8263692d7aba4fad5feae5ad4ab195bdd95 /drivers/tty
parent51abefff9fb42c8834acb643d6aa70d855e0cf43 (diff)
parent1065e41df3d0060f67ea0b2432b252dc9acca341 (diff)
Merge "Merge android-4.4.159 (624c095) into msm-4.4"
Diffstat (limited to 'drivers/tty')
-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 97d5a74558a3..a86bc7afb3b2 100644
--- a/drivers/tty/vt/vt_ioctl.c
+++ b/drivers/tty/vt/vt_ioctl.c
@@ -31,6 +31,8 @@
#include <asm/io.h>
#include <asm/uaccess.h>
+#include <linux/nospec.h>
+
#include <linux/kbd_kern.h>
#include <linux/vt_kern.h>
#include <linux/kbd_diacr.h>
@@ -703,6 +705,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);