All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serge@hallyn.com>
To: Matt Brown <matt@nmatt.com>
Cc: "Serge E. Hallyn" <serge@hallyn.com>,
	Alan Cox <gnomes@lxorguk.ukuu.org.uk>,
	Kees Cook <keescook@chromium.org>,
	Casey Schaufler <casey@schaufler-ca.com>,
	Boris Lukashev <blukashev@sempervictus.com>,
	Greg KH <gregkh@linuxfoundation.org>,
	"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>,
	linux-api@vger.kernel.org
Subject: Re: [kernel-hardening] Re: [PATCH v7 2/2] security: tty: make TIOCSTI ioctl require CAP_SYS_ADMIN
Date: Fri, 2 Jun 2017 13:18:22 -0500	[thread overview]
Message-ID: <20170602181822.GA5125@mail.hallyn.com> (raw)
In-Reply-To: <3027e4fa-5dc2-a52f-8699-9974cb4d4b6b@nmatt.com>

Quoting Matt Brown (matt@nmatt.com):
> On 6/2/17 12:57 PM, Serge E. Hallyn wrote:
> > I'm not quite sure what you're asking for here.  Let me offer a precise
> > strawman design.  I'm sure there are problems with it, it's just a starting
> > point.
> > 
> > system-wide whitelist (for now 'may_push_chars') is full by default.
> > 
> 
> So is may_push_chars just an alias for TIOCSTI? Or are there some
> potential whitelist members that would map to multiple ioctls?

<shrug>  I'm seeing it as only TIOCSTI right now.

> > By default, nothing changes - you can use those on your own tty, need
> > CAP_SYS_ADMIN against init_user_ns otherwise.
> > 
> > Introduce a new CAP_TTY_PRIVILEGED.
> > 
> 
> I'm fine with this.
> 
> > When may_push_chars is removed from the whitelist, you lose the ability
> > to use TIOCSTI on a tty - even your own - if you do not have CAP_TTY_PRIVILEGED
> > against the tty's user_ns.
> > 
> 
> How do you propose storing/updating the whitelist? sysctl?
> 
> If it is a sysctl, would each whitelist member have a sysctl?
> e.g.: kernel.ioctlwhitelist.may_push_chars = 1
> 
> Overall, I'm fine with this idea.

That sounds reasonable.  Or a securityfs file - I guess not everyone
has securityfs, but if it were to become part of YAMA then that would
work.

-serge

WARNING: multiple messages have this Message-ID (diff)
From: "Serge E. Hallyn" <serge-A9i7LUbDfNHQT0dZR+AlfA@public.gmane.org>
To: Matt Brown <matt-YiBOUZGZpYMAvxtiuMwx3w@public.gmane.org>
Cc: "Serge E. Hallyn" <serge-A9i7LUbDfNHQT0dZR+AlfA@public.gmane.org>,
	Alan Cox
	<gnomes-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>,
	Kees Cook <keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	Casey Schaufler <casey-iSGtlc1asvQWG2LlvL+J4A@public.gmane.org>,
	Boris Lukashev
	<blukashev-JNja4Z15B3SvB/ACxS1yDA@public.gmane.org>,
	Greg KH
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	"kernel-hardening-ZwoEplunGu1jrUoiu81ncdBPR1lH4CV8@public.gmane.org"
	<kernel-hardening-ZwoEplunGu1jrUoiu81ncdBPR1lH4CV8@public.gmane.org>,
	linux-security-module
	<linux-security-module-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-kernel
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [kernel-hardening] Re: [PATCH v7 2/2] security: tty: make TIOCSTI ioctl require CAP_SYS_ADMIN
Date: Fri, 2 Jun 2017 13:18:22 -0500	[thread overview]
Message-ID: <20170602181822.GA5125@mail.hallyn.com> (raw)
In-Reply-To: <3027e4fa-5dc2-a52f-8699-9974cb4d4b6b-YiBOUZGZpYMAvxtiuMwx3w@public.gmane.org>

Quoting Matt Brown (matt-YiBOUZGZpYMAvxtiuMwx3w@public.gmane.org):
> On 6/2/17 12:57 PM, Serge E. Hallyn wrote:
> > I'm not quite sure what you're asking for here.  Let me offer a precise
> > strawman design.  I'm sure there are problems with it, it's just a starting
> > point.
> > 
> > system-wide whitelist (for now 'may_push_chars') is full by default.
> > 
> 
> So is may_push_chars just an alias for TIOCSTI? Or are there some
> potential whitelist members that would map to multiple ioctls?

<shrug>  I'm seeing it as only TIOCSTI right now.

> > By default, nothing changes - you can use those on your own tty, need
> > CAP_SYS_ADMIN against init_user_ns otherwise.
> > 
> > Introduce a new CAP_TTY_PRIVILEGED.
> > 
> 
> I'm fine with this.
> 
> > When may_push_chars is removed from the whitelist, you lose the ability
> > to use TIOCSTI on a tty - even your own - if you do not have CAP_TTY_PRIVILEGED
> > against the tty's user_ns.
> > 
> 
> How do you propose storing/updating the whitelist? sysctl?
> 
> If it is a sysctl, would each whitelist member have a sysctl?
> e.g.: kernel.ioctlwhitelist.may_push_chars = 1
> 
> Overall, I'm fine with this idea.

That sounds reasonable.  Or a securityfs file - I guess not everyone
has securityfs, but if it were to become part of YAMA then that would
work.

-serge

WARNING: multiple messages have this Message-ID (diff)
From: serge@hallyn.com (Serge E. Hallyn)
To: linux-security-module@vger.kernel.org
Subject: [kernel-hardening] Re: [PATCH v7 2/2] security: tty: make TIOCSTI ioctl require CAP_SYS_ADMIN
Date: Fri, 2 Jun 2017 13:18:22 -0500	[thread overview]
Message-ID: <20170602181822.GA5125@mail.hallyn.com> (raw)
In-Reply-To: <3027e4fa-5dc2-a52f-8699-9974cb4d4b6b@nmatt.com>

Quoting Matt Brown (matt at nmatt.com):
> On 6/2/17 12:57 PM, Serge E. Hallyn wrote:
> > I'm not quite sure what you're asking for here.  Let me offer a precise
> > strawman design.  I'm sure there are problems with it, it's just a starting
> > point.
> > 
> > system-wide whitelist (for now 'may_push_chars') is full by default.
> > 
> 
> So is may_push_chars just an alias for TIOCSTI? Or are there some
> potential whitelist members that would map to multiple ioctls?

<shrug>  I'm seeing it as only TIOCSTI right now.

> > By default, nothing changes - you can use those on your own tty, need
> > CAP_SYS_ADMIN against init_user_ns otherwise.
> > 
> > Introduce a new CAP_TTY_PRIVILEGED.
> > 
> 
> I'm fine with this.
> 
> > When may_push_chars is removed from the whitelist, you lose the ability
> > to use TIOCSTI on a tty - even your own - if you do not have CAP_TTY_PRIVILEGED
> > against the tty's user_ns.
> > 
> 
> How do you propose storing/updating the whitelist? sysctl?
> 
> If it is a sysctl, would each whitelist member have a sysctl?
> e.g.: kernel.ioctlwhitelist.may_push_chars = 1
> 
> Overall, I'm fine with this idea.

That sounds reasonable.  Or a securityfs file - I guess not everyone
has securityfs, but if it were to become part of YAMA then that would
work.

-serge
--
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

  reply	other threads:[~2017-06-02 18:18 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
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 [this message]
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=20170602181822.GA5125@mail.hallyn.com \
    --to=serge@hallyn.com \
    --cc=blukashev@sempervictus.com \
    --cc=casey@schaufler-ca.com \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=matt@nmatt.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.