public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] TIOCSTI: always enable for CAP_SYS_ADMIN
@ 2023-07-01 23:59 Samuel Thibault
  2023-07-03 19:43 ` Kees Cook
  0 siblings, 1 reply; 4+ messages in thread
From: Samuel Thibault @ 2023-07-01 23:59 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Randy Dunlap, Jiri Slaby, Simon Brand,
	Kees Cook
  Cc: stable, linux-kernel, Dave

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 <samuel.thibault@ens-lyon.org>
Fixes: 83efeeeb3d04 ("tty: Allow TIOCSTI to be disabled")

Index: linux-6.4/drivers/tty/tty_io.c
===================================================================
--- linux-6.4.orig/drivers/tty/tty_io.c
+++ 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))

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] TIOCSTI: always enable for CAP_SYS_ADMIN
  2023-07-01 23:59 [PATCH] TIOCSTI: always enable for CAP_SYS_ADMIN Samuel Thibault
@ 2023-07-03 19:43 ` Kees Cook
  0 siblings, 0 replies; 4+ messages in thread
From: Kees Cook @ 2023-07-03 19:43 UTC (permalink / raw)
  To: Samuel Thibault, Greg Kroah-Hartman, Randy Dunlap, Jiri Slaby,
	Simon Brand, stable, linux-kernel, Dave

On Sun, Jul 02, 2023 at 01:59:18AM +0200, Samuel Thibault wrote:
> 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 <samuel.thibault@ens-lyon.org>
> Fixes: 83efeeeb3d04 ("tty: Allow TIOCSTI to be disabled")

Based on the design of brltty, this appears to be the only solution. I
remain surprised that FreeBSD had no brltty support, which is why they
didn't run into this problem.

Acked-by: Kees Cook <keescook@chromium.org>

-Kees

> 
> Index: linux-6.4/drivers/tty/tty_io.c
> ===================================================================
> --- linux-6.4.orig/drivers/tty/tty_io.c
> +++ 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))

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] TIOCSTI: always enable for CAP_SYS_ADMIN
@ 2023-07-10  0:26 Samuel Thibault
  2023-07-13  6:01 ` Jiri Slaby
  0 siblings, 1 reply; 4+ messages in thread
From: Samuel Thibault @ 2023-07-10  0:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Randy Dunlap, Jiri Slaby, Simon Brand,
	Kees Cook
  Cc: linux-kernel, Dave

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 <samuel.thibault@ens-lyon.org>
Acked-by: Kees Cook <keescook@chromium.org>
Fixes: 83efeeeb3d04 ("tty: Allow TIOCSTI to be disabled")
Cc: stable@vger.kernel.org

Index: linux-6.4/drivers/tty/tty_io.c
===================================================================
--- linux-6.4.orig/drivers/tty/tty_io.c
+++ 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))

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] TIOCSTI: always enable for CAP_SYS_ADMIN
  2023-07-10  0:26 Samuel Thibault
@ 2023-07-13  6:01 ` Jiri Slaby
  0 siblings, 0 replies; 4+ messages in thread
From: Jiri Slaby @ 2023-07-13  6:01 UTC (permalink / raw)
  To: Samuel Thibault, Greg Kroah-Hartman, Randy Dunlap, Simon Brand,
	Kees Cook, linux-kernel, Dave

On 10. 07. 23, 2:26, Samuel Thibault wrote:
> 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 <samuel.thibault@ens-lyon.org>
> Acked-by: Kees Cook <keescook@chromium.org>
> Fixes: 83efeeeb3d04 ("tty: Allow TIOCSTI to be disabled")
> Cc: stable@vger.kernel.org

Acked-by: Jiri Slaby <jirislaby@kernel.org>

thanks,
-- 
js
suse labs


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-13  6:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-01 23:59 [PATCH] TIOCSTI: always enable for CAP_SYS_ADMIN Samuel Thibault
2023-07-03 19:43 ` Kees Cook
  -- strict thread matches above, loose matches on Subject: below --
2023-07-10  0:26 Samuel Thibault
2023-07-13  6:01 ` Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox