Skip to content

Commit 690c8b8

Browse files
sthibaulgregkh
authored andcommitted
TIOCSTI: always enable for CAP_SYS_ADMIN
83efeee ("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: Samuel Thibault <[email protected]> Acked-by: Kees Cook <[email protected]> Fixes: 83efeee ("tty: Allow TIOCSTI to be disabled") Cc: [email protected] Reported-by: Nicolas Pitre <[email protected]> Link: https://lore.kernel.org/r/20230710002645.v565c7xq5iddruse@begin Acked-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent fdf0eaf commit 690c8b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/tty/tty_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2285,7 +2285,7 @@ static int tiocsti(struct tty_struct *tty, char __user *p)
22852285
char ch, mbz = 0;
22862286
struct tty_ldisc *ld;
22872287

2288-
if (!tty_legacy_tiocsti)
2288+
if (!tty_legacy_tiocsti && !capable(CAP_SYS_ADMIN))
22892289
return -EIO;
22902290

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

0 commit comments

Comments
 (0)