All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
To: Matt Brown <matt@nmatt.com>
Cc: gregkh@linuxfoundation.org, serge@hallyn.com,
	keescook@chromium.org, kernel-hardening@lists.openwall.com,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v7 2/2] security: tty: make TIOCSTI ioctl require CAP_SYS_ADMIN
Date: Mon, 29 May 2017 23:26:40 +0100	[thread overview]
Message-ID: <20170529232640.16211960@alans-desktop> (raw)
In-Reply-To: <20170529213800.29438-3-matt@nmatt.com>

On Mon, 29 May 2017 17:38:00 -0400
Matt Brown <matt@nmatt.com> wrote:

> This introduces the tiocsti_restrict sysctl, whose default is controlled
> via CONFIG_SECURITY_TIOCSTI_RESTRICT. When activated, this control
> restricts all TIOCSTI ioctl calls from non CAP_SYS_ADMIN users.

Which is really quite pointless as I keep pointing out and you keep
reposting this nonsense.

> 
> This patch depends on patch 1/2
> 
> This patch was inspired from GRKERNSEC_HARDEN_TTY.
> 
> This patch would have prevented
> https://bugzilla.redhat.com/show_bug.cgi?id=1411256 under the following
> conditions:
> * non-privileged container
> * container run inside new user namespace

And assuming no other ioctl could be used in an attack. Only there are
rather a lot of ways an app with access to a tty can cause mischief if
it's the same controlling tty as the higher privileged context that
launched it.

Properly written code allocates a new pty/tty pair for the lower
privileged session. If the code doesn't do that then your change merely
modifies the degree of mayhem it can cause. If it does it right then your
patch is pointless.

> Possible effects on userland:
> 
> There could be a few user programs that would be effected by this
> change.

In other words, it's yet another weird config option that breaks stuff.


NAK v7.

Alan

WARNING: multiple messages have this Message-ID (diff)
From: gnomes@lxorguk.ukuu.org.uk (Alan Cox)
To: linux-security-module@vger.kernel.org
Subject: [PATCH v7 2/2] security: tty: make TIOCSTI ioctl require CAP_SYS_ADMIN
Date: Mon, 29 May 2017 23:26:40 +0100	[thread overview]
Message-ID: <20170529232640.16211960@alans-desktop> (raw)
In-Reply-To: <20170529213800.29438-3-matt@nmatt.com>

On Mon, 29 May 2017 17:38:00 -0400
Matt Brown <matt@nmatt.com> wrote:

> This introduces the tiocsti_restrict sysctl, whose default is controlled
> via CONFIG_SECURITY_TIOCSTI_RESTRICT. When activated, this control
> restricts all TIOCSTI ioctl calls from non CAP_SYS_ADMIN users.

Which is really quite pointless as I keep pointing out and you keep
reposting this nonsense.

> 
> This patch depends on patch 1/2
> 
> This patch was inspired from GRKERNSEC_HARDEN_TTY.
> 
> This patch would have prevented
> https://bugzilla.redhat.com/show_bug.cgi?id=1411256 under the following
> conditions:
> * non-privileged container
> * container run inside new user namespace

And assuming no other ioctl could be used in an attack. Only there are
rather a lot of ways an app with access to a tty can cause mischief if
it's the same controlling tty as the higher privileged context that
launched it.

Properly written code allocates a new pty/tty pair for the lower
privileged session. If the code doesn't do that then your change merely
modifies the degree of mayhem it can cause. If it does it right then your
patch is pointless.

> Possible effects on userland:
> 
> There could be a few user programs that would be effected by this
> change.

In other words, it's yet another weird config option that breaks stuff.


NAK v7.

Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
To: Matt Brown <matt@nmatt.com>
Cc: gregkh@linuxfoundation.org, serge@hallyn.com,
	keescook@chromium.org, kernel-hardening@lists.openwall.com,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [kernel-hardening] Re: [PATCH v7 2/2] security: tty: make TIOCSTI ioctl require CAP_SYS_ADMIN
Date: Mon, 29 May 2017 23:26:40 +0100	[thread overview]
Message-ID: <20170529232640.16211960@alans-desktop> (raw)
In-Reply-To: <20170529213800.29438-3-matt@nmatt.com>

On Mon, 29 May 2017 17:38:00 -0400
Matt Brown <matt@nmatt.com> wrote:

> This introduces the tiocsti_restrict sysctl, whose default is controlled
> via CONFIG_SECURITY_TIOCSTI_RESTRICT. When activated, this control
> restricts all TIOCSTI ioctl calls from non CAP_SYS_ADMIN users.

Which is really quite pointless as I keep pointing out and you keep
reposting this nonsense.

> 
> This patch depends on patch 1/2
> 
> This patch was inspired from GRKERNSEC_HARDEN_TTY.
> 
> This patch would have prevented
> https://bugzilla.redhat.com/show_bug.cgi?id=1411256 under the following
> conditions:
> * non-privileged container
> * container run inside new user namespace

And assuming no other ioctl could be used in an attack. Only there are
rather a lot of ways an app with access to a tty can cause mischief if
it's the same controlling tty as the higher privileged context that
launched it.

Properly written code allocates a new pty/tty pair for the lower
privileged session. If the code doesn't do that then your change merely
modifies the degree of mayhem it can cause. If it does it right then your
patch is pointless.

> Possible effects on userland:
> 
> There could be a few user programs that would be effected by this
> change.

In other words, it's yet another weird config option that breaks stuff.


NAK v7.

Alan

  reply	other threads:[~2017-05-29 22:26 UTC|newest]

Thread overview: 132+ 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 ` [kernel-hardening] " Matt Brown
2017-05-29 21:37 ` 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:37   ` [kernel-hardening] " Matt Brown
2017-05-29 21:37   ` 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 21:38   ` [kernel-hardening] " Matt Brown
2017-05-29 21:38   ` Matt Brown
2017-05-29 22:26   ` Alan Cox [this message]
2017-05-29 22:26     ` [kernel-hardening] " Alan Cox
2017-05-29 22:26     ` Alan Cox
2017-05-29 23:51     ` [kernel-hardening] " Boris Lukashev
2017-05-29 23:51       ` Boris Lukashev
2017-05-30  0:27       ` Casey Schaufler
2017-05-30  0:27         ` Casey Schaufler
2017-05-30  2:00         ` Matt Brown
2017-05-30  2:00           ` Matt Brown
2017-05-30  2:46           ` Casey Schaufler
2017-05-30  2:46             ` Casey Schaufler
2017-05-30  3:18             ` Matt Brown
2017-05-30  3:18               ` Matt Brown
2017-05-30 12:24               ` Alan Cox
2017-05-30 12:24                 ` Alan Cox
2017-05-30 16:28                 ` Matt Brown
2017-05-30 16:28                   ` Matt Brown
2017-05-30 16:44                   ` Daniel Micay
2017-05-30 16:44                     ` Daniel Micay
2017-05-30 18:32                   ` Stephen Smalley
2017-05-30 18:32                     ` Stephen Smalley
2017-05-30 18:44                     ` Nick Kralevich
2017-05-30 18:44                       ` Nick Kralevich
2017-05-30 18:57                       ` Matt Brown
2017-05-30 18:57                         ` Matt Brown
2017-05-30 20:22                         ` Daniel Micay
2017-05-30 20:22                           ` Daniel Micay
2017-05-30 23:00                           ` Matt Brown
2017-05-30 23:00                             ` Matt Brown
2017-05-30 23:40                             ` Daniel Micay
2017-05-30 23:40                               ` Daniel Micay
2017-05-30 23:59                               ` Matt Brown
2017-05-30 23:59                                 ` Matt Brown
2017-05-30 22:51                   ` Alan Cox
2017-05-30 22:51                     ` Alan Cox
2017-05-30 23:19                     ` Matt Brown
2017-05-30 23:19                       ` Matt Brown
2017-05-30 23:56                       ` Alan Cox
2017-05-30 23:56                         ` Alan Cox
2017-06-01  2:35                         ` Kees Cook
2017-06-01  2:35                           ` Kees Cook
2017-06-01  2:35                           ` Kees Cook
2017-06-01  7:12                           ` lazytyped
2017-06-01 18:46                             ` Kees Cook
2017-06-01 22:56                               ` James Morris
2017-06-02 18:46                                 ` Kees Cook
2017-06-01 13:08                           ` Alan Cox
2017-06-01 13:08                             ` Alan Cox
2017-06-01 13:08                             ` Alan Cox
2017-06-01 17:18                             ` Serge E. Hallyn
2017-06-01 17:18                               ` Serge E. Hallyn
2017-06-01 17:18                               ` Serge E. Hallyn
2017-06-01 21:26                               ` Alan Cox
2017-06-01 21:26                                 ` Alan Cox
2017-06-01 21:26                                 ` Alan Cox
2017-06-01 18:58                             ` Kees Cook
2017-06-01 18:58                               ` Kees Cook
2017-06-01 18:58                               ` Kees Cook
2017-06-01 21:24                               ` Alan Cox
2017-06-01 21:24                                 ` Alan Cox
2017-06-01 21:24                                 ` Alan Cox
2017-06-02 14:46                                 ` Matt Brown
2017-06-02 14:46                                   ` Matt Brown
2017-06-02 14:46                                   ` Matt Brown
2017-06-02 15:36                                   ` Serge E. Hallyn
2017-06-02 15:36                                     ` Serge E. Hallyn
2017-06-02 15:36                                     ` Serge E. Hallyn
2017-06-02 16:02                                     ` Matt Brown
2017-06-02 16:02                                       ` Matt Brown
2017-06-02 16:02                                       ` Matt Brown
2017-06-02 16:57                                       ` Serge E. Hallyn
2017-06-02 16:57                                         ` Serge E. Hallyn
2017-06-02 16:57                                         ` Serge E. Hallyn
2017-06-02 16:57                                         ` Serge E. Hallyn
2017-06-02 17:32                                         ` Matt Brown
2017-06-02 17:32                                           ` Matt Brown
2017-06-02 17:32                                           ` Matt Brown
2017-06-02 18:18                                           ` Serge E. Hallyn
2017-06-02 18:18                                             ` Serge E. Hallyn
2017-06-02 18:18                                             ` Serge E. Hallyn
2017-06-02 18:18                                             ` Serge E. Hallyn
2017-06-02 19:22                                             ` Matt Brown
2017-06-02 19:22                                               ` Matt Brown
2017-06-02 19:22                                               ` Matt Brown
2017-06-02 19:25                                               ` Kees Cook
2017-06-02 19:25                                                 ` Kees Cook
2017-06-02 19:25                                                 ` Kees Cook
2017-06-02 19:25                                                 ` Kees Cook
2017-06-02 19:26                                                 ` Matt Brown
2017-06-02 19:26                                                   ` Matt Brown
2017-06-02 19:26                                                   ` Matt Brown
2017-06-02 19:26                                                   ` Matt Brown
2017-06-02 20:05                                       ` Alan Cox
2017-06-02 20:05                                         ` Alan Cox
2017-06-02 20:05                                         ` Alan Cox
2017-06-02 20:11                                         ` Nick Kralevich
2017-06-02 20:11                                           ` Nick Kralevich
2017-06-02 20:11                                           ` Nick Kralevich
2017-06-02 20:46                                         ` Matt Brown
2017-06-02 20:46                                           ` Matt Brown
2017-06-02 20:46                                           ` Matt Brown
2017-06-03 22:00                                           ` Alan Cox
2017-06-03 22:00                                             ` Alan Cox
2017-06-03 22:00                                             ` Alan Cox
2017-06-03 22:22                                             ` Matt Brown
2017-06-03 22:22                                               ` Matt Brown
2017-06-03 22:22                                               ` Matt Brown
2017-06-04  3:37                                               ` Peter Dolding
2017-06-04  3:37                                                 ` Peter Dolding
2017-06-04  3:37                                                 ` Peter Dolding
2017-05-30 15:20               ` Casey Schaufler
2017-05-30 15:20                 ` Casey Schaufler
2017-05-30 16:09                 ` Matt Brown
2017-05-30 16:09                   ` Matt Brown
2017-06-04  6:29         ` Boris Lukashev
2017-06-04  6:29           ` Boris Lukashev
2017-05-31  2:48       ` James Morris
2017-05-31  2:48         ` James Morris
2017-05-31  4:10         ` Matt Brown
2017-05-31  4:10           ` Matt Brown
2017-05-30  0:15     ` Matt Brown
2017-05-30  0:15       ` [kernel-hardening] " 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=20170529232640.16211960@alans-desktop \
    --to=gnomes@lxorguk.ukuu.org.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=keescook@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.