public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Kees Cook <kees@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	Simon Brand <simon.brand@postadigitale.de>,
	linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org,
	Dave@mielke.cc
Subject: Re: [PATCH v3 2/2] tty: Allow TIOCSTI to be disabled
Date: Wed, 28 Jun 2023 09:32:20 -0700	[thread overview]
Message-ID: <202306280930.8CBBB9B@keescook> (raw)
In-Reply-To: <20230628060716.vvgtlgbushyjh6km@begin>

On Wed, Jun 28, 2023 at 08:07:16AM +0200, Samuel Thibault wrote:
> Kees Cook, le mar. 27 juin 2023 19:48:45 -0700, a ecrit:
> > On Sun, Jun 25, 2023 at 05:56:25PM +0200, Samuel Thibault wrote:
> > > > Can we perhaps just introduce a CAP_TIOCSTI that the brltty daemon would
> > > > be able to use? We could even make it only allow TIOCSTI on the linux
> > > > console (tty->ops == con_ops).
> > 
> > Does brltty run with CAP_SYS_ADMIN?
> 
> ATM most often, yes, though we are trying to reduce the CAP_* privileges
> to what it actually needs.
> 
> > > *Please* comment on this so we can progress. ATM people are
> > > advising each other to set dev.tty.legacy_tiocsti=1, which is just
> > > counter-productive in terms of security...
> > 
> > So is there really no solution for brltty and TIOCSTI being disabled?
> 
> No, there is no way to simulate characters on the Linux console. The
> alternative would be to use uinput, but that simulates keycodes, not
> characters, thus requiring backtranslating first, which is very fragile.
> 
> > What is FreeBSD doing? I imagine it's the same situation there too,
> > though maybe there is just no support?
> 
> There is just no support in the kernel, only a patch against "screen".
> 
> > > Really, this a serious regression for the people affected by this.
> > 
> > Can you send a patch adding a CAP_SYS_ADMIN exception?
> 
> Sure!

Thanks! (And be sure to use file->f_cred for the check[1], not "current",
that way brltty can open the tty and drop caps and still do the ioctl.)

-Kees

https://docs.kernel.org/security/credentials.html?highlight=confused+deputy#open-file-credentials

-- 
Kees Cook

  reply	other threads:[~2023-06-28 16:33 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-22 18:29 [PATCH v3 0/2] tty: Allow TIOCSTI to be disabled Kees Cook
2022-10-22 18:29 ` [PATCH v3 1/2] tty: Move sysctl setup into "core" tty logic Kees Cook
2022-10-22 18:29 ` [PATCH v3 2/2] tty: Allow TIOCSTI to be disabled Kees Cook
2022-11-15 13:17   ` Geert Uytterhoeven
2022-12-27 23:40   ` Samuel Thibault
2022-12-27 23:41     ` Samuel Thibault
2022-12-28  3:32     ` Kees Cook
2022-12-28 20:57       ` Samuel Thibault
2023-06-25 15:56         ` Samuel Thibault
2023-06-27 21:50           ` Samuel Thibault
2023-06-28  0:21             ` Paul Moore
2023-06-28  2:48           ` Kees Cook
2023-06-28  6:07             ` Samuel Thibault
2023-06-28 16:32               ` Kees Cook [this message]
2023-07-02  0:00                 ` Samuel Thibault
2023-07-03 19:41                   ` Kees Cook
2023-06-29 13:23               ` David Laight
2023-06-29 13:32                 ` Samuel Thibault
2022-11-02  2:15 ` [PATCH v3 0/2] " Kees Cook
2022-11-02  2:29   ` Greg Kroah-Hartman
2022-11-02  2:46     ` Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202306280930.8CBBB9B@keescook \
    --to=keescook@chromium.org \
    --cc=Dave@mielke.cc \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=kees@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=simon.brand@postadigitale.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox