From: Jann Horn <jann@thejh.net>
To: Casey Schaufler <casey@schaufler-ca.com>
Cc: kernel-hardening@lists.openwall.com,
linux-security-module@vger.kernel.org, keescook@chromium.org,
spender@grsecurity.net, jmorris@namei.org,
casey.schaufler@intel.com, michael.leibowitz@intel.com,
william.c.roberts@intel.com,
Elena Reshetova <elena.reshetova@intel.com>
Subject: Re: [kernel-hardening] [RFC] [PATCH 5/5] Hardchroot LSM
Date: Fri, 29 Jul 2016 23:50:46 +0200 [thread overview]
Message-ID: <20160729215046.GA31618@pc.thejh.net> (raw)
In-Reply-To: <6ff8fdb1-247b-1f58-bded-c6f274feb20c@schaufler-ca.com>
[-- Attachment #1: Type: text/plain, Size: 3091 bytes --]
On Fri, Jul 29, 2016 at 02:10:31PM -0700, Casey Schaufler wrote:
> On 7/29/2016 1:53 PM, Jann Horn wrote:
> > On Fri, Jul 29, 2016 at 12:20:56PM -0700, Casey Schaufler wrote:
> >> On 7/29/2016 11:53 AM, Jann Horn wrote:
[...]
> > And when you look at Linux 0.10, you'll see that already back
> > then, sys_chroot() just updated current->root; sending signals
> > to other processes, setting the system time and so on just did
> > UID checks.
> >
> >
> >>> and chroot "jails" break in a number
> >>> of different ways.
> >> All of which were introduced after the fact, and most of which
> >> have been introduced in spite of the objections of the security
> >> community. Even sockets, which are the biggest single breakage
> >> (followed closely by the process namespace and SVIPC) came along
> >> well after chroot and really should have taken the "root" into
> >> account.
> > Namespaces on Linux actually take chroots into account - you can't
> > create a new namespace if you're unprivileged and inside a chroot,
> > see commit 3151527ee0. I'm not sure whether that was added before
> > or after unprivileged user namespaces were enabled.
> >
> >
> >>> A lot of effort went into making bind mounts
> >>> actually secure with reasonable performance, and I doubt that
> >>> something like this can provide anything close to that, at least
> >>> not without gigantic runtime overhead. Instead of making people
> >>> believe that it's now okay to use chroot for security, I would
> >>> very much prefer to keep the "never use this for security
> >>> purposes" warning in the chroot() manpage and encourage people
> >>> to use namespaces with bind mounts instead.
> >> There is merit to the argument that namespaces are better than
> >> chroot jails. Nonetheless, we're all aware of just how much
> >> legacy code we're going to have to deal with for the next
> >> forever, and some of that can benefit from this work.
> > Eh. For that, you could also make a shim that turns chroot into
> > namespace creation automatically
>
> Right. Why carry a tent when you can pull a 24' Airsteam trailer? :)
Because that "tent" would be a lot of messy parts all over your house
while the "Airsteam trailer" could maybe be parked outside and
wouldn't be in the way every time you want to make coffee?
And besides, since lots of people are going to build their own
trailers, it might make sense to have your own so that you can show
people what a proper trailer looks like.
(And if multithreaded namespace creation is needed for this, it
might be nice to have anyway, considering that people want to use
namespaces from languages like Go, where they currently have to
implement the unsharing in C before the runtime starts up - I think
that was e.g. the case in subgraph's oz. This could probably be
implemented similar to grsecurity's GRKERNSEC_SETXID. I think this
isn't exactly a priority at the moment, but as people start using
memory-safe languages with GC for low-level stuff like this, it
might become more important - I don't know.)
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-07-29 21:50 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-29 7:34 [kernel-hardening] [RFC] [PATCH 0/5] Hardchroot LSM + additional hooks Elena Reshetova
2016-07-29 7:34 ` [kernel-hardening] [RFC] [PATCH 1/5] path_fchdir and path_fhandle LSM hooks Elena Reshetova
2016-07-29 18:12 ` Jann Horn
2016-07-31 10:55 ` Reshetova, Elena
2016-07-31 12:02 ` Jann Horn
2016-07-31 18:28 ` Reshetova, Elena
2016-07-31 21:23 ` Jann Horn
2016-08-01 8:38 ` Reshetova, Elena
2016-07-29 7:34 ` [kernel-hardening] [RFC] [PATCH 2/5] task_unshare LSM hook Elena Reshetova
2016-07-29 17:58 ` Jann Horn
2016-07-29 18:17 ` Reshetova, Elena
2016-07-29 7:34 ` [kernel-hardening] [RFC] [PATCH 3/5] sb_unsharefs " Elena Reshetova
2016-07-29 18:02 ` Jann Horn
2016-07-29 18:09 ` Reshetova, Elena
2016-07-29 18:15 ` Jann Horn
2016-07-29 18:19 ` Reshetova, Elena
2016-07-29 7:34 ` [kernel-hardening] [RFC] [PATCH 4/5] invoke path_chroot() LSM hook on mntns_install() Elena Reshetova
2016-07-29 18:11 ` Jann Horn
2016-07-31 10:39 ` Reshetova, Elena
2016-07-31 11:29 ` Jann Horn
2016-08-01 9:26 ` Reshetova, Elena
2016-07-29 7:34 ` [kernel-hardening] [RFC] [PATCH 5/5] Hardchroot LSM Elena Reshetova
2016-07-29 11:44 ` [kernel-hardening] " Brad Spengler
2016-07-29 12:15 ` [kernel-hardening] " Reshetova, Elena
2016-07-29 12:25 ` Reshetova, Elena
2016-07-29 18:53 ` [kernel-hardening] " Jann Horn
2016-07-29 19:20 ` Casey Schaufler
2016-07-29 20:53 ` Jann Horn
2016-07-29 21:10 ` Casey Schaufler
2016-07-29 21:50 ` Jann Horn [this message]
2016-07-30 6:10 ` Reshetova, Elena
2016-08-03 6:36 ` [kernel-hardening] Re: [RFC] [PATCH 0/5] Hardchroot LSM + additional hooks James Morris
2016-08-05 7:53 ` [kernel-hardening] " Reshetova, Elena
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=20160729215046.GA31618@pc.thejh.net \
--to=jann@thejh.net \
--cc=casey.schaufler@intel.com \
--cc=casey@schaufler-ca.com \
--cc=elena.reshetova@intel.com \
--cc=jmorris@namei.org \
--cc=keescook@chromium.org \
--cc=kernel-hardening@lists.openwall.com \
--cc=linux-security-module@vger.kernel.org \
--cc=michael.leibowitz@intel.com \
--cc=spender@grsecurity.net \
--cc=william.c.roberts@intel.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.