aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <[email protected]>2023-07-10 02:26:45 +0200
committerGreg Kroah-Hartman <[email protected]>2023-07-20 19:21:16 +0200
commit690c8b804ad2eafbd35da5d3c95ad325ca7d5061 (patch)
tree8c6cec078caf83d111474b36550e9812d493e6c4
parentfdf0eaf11452d72945af31804e2a1048ee1b574c (diff)
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. Signed-off-by: Samuel Thibault <[email protected]> Acked-by: Kees Cook <[email protected]> Fixes: 83efeeeb3d04 ("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]>
-rw-r--r--drivers/tty/tty_io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 3959efc717aa..63db04b9113a 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -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))