linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
Cc: Matt Brown <matt@nmatt.com>,
	Casey Schaufler <casey@schaufler-ca.com>,
	Boris Lukashev <blukashev@sempervictus.com>,
	Greg KH <gregkh@linuxfoundation.org>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	"kernel-hardening@lists.openwall.com" 
	<kernel-hardening@lists.openwall.com>,
	linux-security-module <linux-security-module@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [kernel-hardening] Re: [PATCH v7 2/2] security: tty: make TIOCSTI ioctl require CAP_SYS_ADMIN
Date: Wed, 31 May 2017 19:35:55 -0700	[thread overview]
Message-ID: <CAGXu5j+pqD1082fYDS_dvDB2QNvt9wSz+C7vAhGpMXcJWxoDkw@mail.gmail.com> (raw)
In-Reply-To: <20170531005633.484a2e14@alans-desktop>

On Tue, May 30, 2017 at 4:56 PM, Alan Cox <gnomes@lxorguk.ukuu.org.uk> wrote:
>> This is my point. Apps will continue to shoot themselves in the foot. Of course
>> the correct response to one of these vulns is to not pass ttys across a
>> security boundary. We have an opportunity here to reduce the impact of this bug
>> class at the kernel level.
>
> Not really.
>
> If you pass me your console for example I can mmap your framebuffer and
> spy on you all day. Or I could reprogram your fonts, your keyboard, your
> video mode, or use set and paste selection to write stuff. If you are
> using X and you can't get tty handles right you'll no doubt pass me a
> copy of your X file descriptor in which case I own your display, your
> keyboard and your mouse and I don't need to use TIOCSTI there either.
>
> There are so many different attacks based upon that screwup that the
> kernel cannot defend against them. You aren't exactly reducing the impact.

I still cannot wrap my head around why providing users with a
protection is a bad thing. Yes, the other tty games are bad, but this
fixes a specific and especially bad case that is easy to kill. It's
got a Kconfig and a sysctl. It's not on by default. This protects the
common case of privileged ttys that aren't attached to consoles, etc,
so while the framebuffer thing is an issue, it's not always an issue,
etc.

I'd like to hear Greg's thoughts on this series...

-Kees

-- 
Kees Cook
Pixel Security

  reply	other threads:[~2017-06-01  2:36 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-29 21:37 [PATCH v7 0/2] security: tty: make TIOCSTI ioctl require CAP_SYS_ADMIN Matt Brown
2017-05-29 21:37 ` [PATCH v7 1/2] security: tty: Add owner user namespace to tty_struct Matt Brown
2017-05-29 21:38 ` [PATCH v7 2/2] security: tty: make TIOCSTI ioctl require CAP_SYS_ADMIN Matt Brown
2017-05-29 22:26   ` Alan Cox
2017-05-29 23:51     ` [kernel-hardening] " Boris Lukashev
2017-05-30  0:27       ` Casey Schaufler
2017-05-30  2:00         ` Matt Brown
2017-05-30  2:46           ` Casey Schaufler
2017-05-30  3:18             ` Matt Brown
2017-05-30 12:24               ` Alan Cox
2017-05-30 16:28                 ` Matt Brown
2017-05-30 16:44                   ` Daniel Micay
2017-05-30 18:32                   ` Stephen Smalley
2017-05-30 18:44                     ` Nick Kralevich
2017-05-30 18:57                       ` Matt Brown
2017-05-30 20:22                         ` Daniel Micay
2017-05-30 23:00                           ` Matt Brown
2017-05-30 23:40                             ` Daniel Micay
2017-05-30 23:59                               ` Matt Brown
2017-05-30 22:51                   ` Alan Cox
2017-05-30 23:19                     ` Matt Brown
2017-05-30 23:56                       ` Alan Cox
2017-06-01  2:35                         ` Kees Cook [this message]
2017-06-01 13:08                           ` Alan Cox
2017-06-01 17:18                             ` Serge E. Hallyn
2017-06-01 21:26                               ` Alan Cox
2017-06-01 18:58                             ` Kees Cook
2017-06-01 21:24                               ` Alan Cox
2017-06-02 14:46                                 ` Matt Brown
2017-06-02 15:36                                   ` Serge E. Hallyn
2017-06-02 16:02                                     ` Matt Brown
2017-06-02 16:57                                       ` Serge E. Hallyn
2017-06-02 17:32                                         ` Matt Brown
2017-06-02 18:18                                           ` Serge E. Hallyn
2017-06-02 19:22                                             ` Matt Brown
2017-06-02 19:25                                               ` Kees Cook
2017-06-02 19:26                                                 ` Matt Brown
2017-06-02 20:05                                       ` Alan Cox
2017-06-02 20:11                                         ` Nick Kralevich
2017-06-02 20:46                                         ` Matt Brown
2017-06-03 22:00                                           ` Alan Cox
2017-06-03 22:22                                             ` Matt Brown
2017-06-04  3:37                                               ` Peter Dolding
2017-05-30 15:20               ` Casey Schaufler
2017-05-30 16:09                 ` Matt Brown
2017-06-04  6:29         ` Boris Lukashev
2017-05-31  2:48       ` James Morris
2017-05-31  4:10         ` Matt Brown
2017-05-30  0:15     ` Matt Brown

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=CAGXu5j+pqD1082fYDS_dvDB2QNvt9wSz+C7vAhGpMXcJWxoDkw@mail.gmail.com \
    --to=keescook@chromium.org \
    --cc=blukashev@sempervictus.com \
    --cc=casey@schaufler-ca.com \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=matt@nmatt.com \
    --cc=serge@hallyn.com \
    /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;
as well as URLs for NNTP newsgroup(s).