From: Colin Walters <walters@verbum.org>
To: Andy Lutomirski <luto@MIT.EDU>
Cc: LKML <linux-kernel@vger.kernel.org>,
Daniel Walsh <dwalsh@redhat.com>,
Stephen Smalley <sds@tycho.nsa.gov>, kzak <kzak@redhat.com>
Subject: Re: chroot(2) and bind mounts as non-root
Date: Thu, 08 Dec 2011 11:58:13 -0500 [thread overview]
Message-ID: <1323363493.10724.58.camel@lenny> (raw)
In-Reply-To: <4EDFC123.6070003@mit.edu>
On Wed, 2011-12-07 at 11:40 -0800, Andy Lutomirski wrote:
> I will personally always be nervous until something like this happens:
>
> http://thread.gmane.org/gmane.linux.kernel.lsm/10659
>
> execve() is IMO scary.
Yeah, this came up in the context of the seccomp filter stuff too.
So...it's worth noting that as far as SELinux goes, the beautiful thing
is that setuid only changes uid - it doesn't (by default) change the
domain. So in this case for example, if the calling domain doesn't
have:
self:capable { setpcap sys_chroot }
The binary is just going to error out. Very few domains in the
reference policy have either of those, and only one non-unconfined
domain has both - seunshare. (At least via grep, I didn't try an
analysis tool).
Oh crap, speaking of seunshare:
https://bugzilla.redhat.com/show_bug.cgi?id=633544
They should clearly be using SECBIT_NOROOT too - that would have avoided
the original hole.
In fact, I now notice my program is a safer generalization of seunshare.
I've added dwalsh to CC.
As far as other LSMs go - honestly I'm in the camp that they're stupid,
and SELinux is the only sane one. That and opt-in application controls
such as seccomp are where we should be headed.
So instead of your execve_nosecurity, why don't we make SECBIT_NOROOT
disable domain transitions too? (And encourage the other LSMs to treat
it similarly).
Here's some further food for thought - what if we made certain system
calls that were previously privileged suddenly start working if the
process is SECBIT_NOROOT | SECBIT_NOROOT_LOCKED? I'm specifically
thinking of unshare(2) and chroot(2). The tricky part is more allowing
a subset of mount system calls (I need to be able to mount procfs, but
clearly we don't want the user to be able to mount real devices).
next prev parent reply other threads:[~2011-12-08 16:58 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-07 17:54 chroot(2) and bind mounts as non-root Colin Walters
2011-12-07 19:36 ` John Stoffel
2011-12-08 16:10 ` Colin Walters
2011-12-08 18:14 ` John Stoffel
2011-12-08 18:26 ` Colin Walters
2011-12-09 0:49 ` Sven-Haegar Koch
2011-12-09 14:55 ` John Stoffel
2011-12-09 15:06 ` Colin Walters
2011-12-08 17:04 ` Arnd Bergmann
2011-12-08 17:15 ` Colin Walters
2011-12-07 19:40 ` Andy Lutomirski
2011-12-08 16:58 ` Colin Walters [this message]
2011-12-07 20:34 ` H. Peter Anvin
2011-12-07 20:54 ` Alan Cox
2011-12-15 18:55 ` Andrew G. Morgan
2011-12-16 15:44 ` Colin Walters
2011-12-18 1:22 ` Andrew G. Morgan
2011-12-18 15:19 ` Colin Walters
2011-12-10 5:29 ` Serge E. Hallyn
2011-12-12 16:41 ` Colin Walters
2011-12-12 23:11 ` Serge E. Hallyn
2011-12-15 20:56 ` Colin Walters
2011-12-16 6:14 ` Eric W. Biederman
2011-12-18 16:01 ` Colin Walters
2011-12-19 0:55 ` Eric W. Biederman
2011-12-19 4:06 ` Serge E. Hallyn
2011-12-19 9:22 ` Eric W. Biederman
2011-12-20 16:49 ` Colin Walters
2011-12-20 21:23 ` Colin Walters
2011-12-21 18:15 ` Steve Grubb
2012-01-03 23:13 ` Eric W. Biederman
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=1323363493.10724.58.camel@lenny \
--to=walters@verbum.org \
--cc=dwalsh@redhat.com \
--cc=kzak@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@MIT.EDU \
--cc=sds@tycho.nsa.gov \
/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