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

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@begin


Acked-by: default avatarJiri Slaby <jirislaby@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fdf0eaf1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2285,7 +2285,7 @@ static int tiocsti(struct tty_struct *tty, char __user *p)
	char ch, mbz = 0;
	struct tty_ldisc *ld;

	if (!tty_legacy_tiocsti)
	if (!tty_legacy_tiocsti && !capable(CAP_SYS_ADMIN))
		return -EIO;

	if ((current->signal->tty != tty) && !capable(CAP_SYS_ADMIN))