Skip to content

Commit 0c9acb1

Browse files
npitregregkh
authored andcommitted
vcs: prevent write access to vcsu devices
Commit d21b0be ("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 <[email protected]> Signed-off-by: Nicolas Pitre <[email protected]> Cc: <[email protected]> # v4.19+ Cc: Jiri Slaby <[email protected]> Fixes: d21b0be ("vt: introduce unicode mode for /dev/vcs") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b2b2dd7 commit 0c9acb1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/tty/vt/vc_screen.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,9 @@ vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
456456
size_t ret;
457457
char *con_buf;
458458

459+
if (use_unicode(inode))
460+
return -EOPNOTSUPP;
461+
459462
con_buf = (char *) __get_free_page(GFP_KERNEL);
460463
if (!con_buf)
461464
return -ENOMEM;

0 commit comments

Comments
 (0)