summaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorNicolas Pitre <nico@fluxnic.net>2019-11-05 10:33:16 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-13 08:49:41 +0100
commita006855c86ede879fd57b6a944cd9a5b89a9cdce (patch)
treea57fa266d0057e768aa47ce9ff473c2adbd81d3f /drivers/tty
parentdf06454a0d51ba1905af12bdac26a12c1c5e3ca0 (diff)
downloadlinux-stable-a006855c86ede879fd57b6a944cd9a5b89a9cdce.tar.gz
linux-stable-a006855c86ede879fd57b6a944cd9a5b89a9cdce.tar.bz2
linux-stable-a006855c86ede879fd57b6a944cd9a5b89a9cdce.zip
vcs: prevent write access to vcsu devices
commit 0c9acb1af77a3cb8707e43f45b72c95266903cee upstream. Commit d21b0be246bf ("vt: introduce unicode mode for /dev/vcs") guarded against using devices containing attributes as this is not yet implemented. It however failed to guard against writes to any devices as this is also unimplemented. Reported-by: Or Cohen <orcohen@paloaltonetworks.com> Signed-off-by: Nicolas Pitre <npitre@baylibre.com> Cc: <stable@vger.kernel.org> # v4.19+ Cc: Jiri Slaby <jslaby@suse.com> Fixes: d21b0be246bf ("vt: introduce unicode mode for /dev/vcs") Link: https://lore.kernel.org/r/nycvar.YSQ.7.76.1911051030580.30289@knanqh.ubzr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/vt/vc_screen.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c
index 1f042346e722..778f83ea2249 100644
--- a/drivers/tty/vt/vc_screen.c
+++ b/drivers/tty/vt/vc_screen.c
@@ -456,6 +456,9 @@ vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
size_t ret;
char *con_buf;
+ if (use_unicode(inode))
+ return -EOPNOTSUPP;
+
con_buf = (char *) __get_free_page(GFP_KERNEL);
if (!con_buf)
return -ENOMEM;