Commit 690c8b80 authored by Samuel Thibault's avatar Samuel Thibault Committed by Greg Kroah-Hartman

TIOCSTI: always enable for CAP_SYS_ADMIN

83efeeeb ("tty: Allow TIOCSTI to be disabled") broke BRLTTY's
ability to simulate keypresses on the console, thus effectively breaking
braille keyboards of blind users.

This restores the TIOCSTI feature for CAP_SYS_ADMIN processes, which
BRLTTY is, thus fixing braille keyboards without re-opening the security
issue.
Signed-off-by: default avatarSamuel Thibault <samuel.thibault@ens-lyon.org>
Acked-by: default avatarKees Cook <keescook@chromium.org>
Fixes: 83efeeeb ("tty: Allow TIOCSTI to be disabled")
Cc: stable@vger.kernel.org
Reported-by: default avatarNicolas Pitre <nico@fluxnic.net>
Link: https://lore.kernel.org/r/20230710002645.v565c7xq5iddruse@beginAcked-by: default avatarJiri Slaby <jirislaby@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fdf0eaf1
...@@ -2285,7 +2285,7 @@ static int tiocsti(struct tty_struct *tty, char __user *p) ...@@ -2285,7 +2285,7 @@ static int tiocsti(struct tty_struct *tty, char __user *p)
char ch, mbz = 0; char ch, mbz = 0;
struct tty_ldisc *ld; struct tty_ldisc *ld;
if (!tty_legacy_tiocsti) if (!tty_legacy_tiocsti && !capable(CAP_SYS_ADMIN))
return -EIO; return -EIO;
if ((current->signal->tty != tty) && !capable(CAP_SYS_ADMIN)) if ((current->signal->tty != tty) && !capable(CAP_SYS_ADMIN))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment