Skip to contentSkip to conversation

TIOCSTI: always enable for CAP_SYS_ADMIN

PATCH In review Samuel Thibault 2 participants 2 messages Jul 10, 2023 – Jul 13, 2023 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 TIOCSTI: always enable for CAP_SYS_ADMIN

83efeeeb3d04 ("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.

Fixes 83efeeeb3d04 ("tty: Allow TIOCSTI to be disabled")
drivers/tty/tty_io.c +1 -1
Index: linux-6.4/drivers/tty/tty_io.c
===================================================================
@@ -2276,7 +2276,7 @@ static int tiocsti(struct tty_struct *tt
 	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))
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Samuel Thibault

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

Quoted 8 lines

This restores the TIOCSTI feature for CAP_SYS_ADMIN processes, which BRLTTY is, thus fixing braille keyboards without re-opening the security issue.

Fixes 83efeeeb3d04 ("tty: Allow TIOCSTI to be disabled")

thanks,

Signature · 2 lines
js
suse labs