From: "Serge E. Hallyn" <serge-A9i7LUbDfNHQT0dZR+AlfA@public.gmane.org>
To: "Serge E. Hallyn" <serge.hallyn-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
Cc: Andy Lutomirski <luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org>,
Jann Horn <jann-XZ1E9jl8jIdeoWH0uzbU5w@public.gmane.org>,
"Serge E. Hallyn" <serge-A9i7LUbDfNHQT0dZR+AlfA@public.gmane.org>,
"Eric W. Biederman"
<ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>,
lkml <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Andrew Morgan <morgan-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
LXC development mailing-list
<lxc-devel-cunTk1MwBs9qMoObBWhMNEqPaTDuhLve2LY78lusg7I@public.gmane.org>,
Richard Weinberger <richard-/L3Ra7n9ekc@public.gmane.org>,
LSM
<linux-security-module-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Linux API <linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Kees Cook <keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
Christian Brauner
<christian.brauner-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>
Subject: Re: [PATCH RFC] Introduce new security.nscapability xattr
Date: Mon, 29 Feb 2016 15:38:20 -0600 [thread overview]
Message-ID: <20160229213820.GA1215@mail.hallyn.com> (raw)
In-Reply-To: <20160129073151.GA23156-7LNsyQBKDXoIagZqoN9o3w@public.gmane.org>
On Fri, Jan 29, 2016 at 01:31:51AM -0600, Serge E. Hallyn wrote:
> On Wed, Jan 27, 2016 at 04:36:02PM -0800, Andy Lutomirski wrote:
> > On Wed, Jan 27, 2016 at 9:22 AM, Jann Horn <jann-XZ1E9jl8jIdeoWH0uzbU5w@public.gmane.org> wrote:
> > > I think it sounds good from a security perspective.
> >
> > I'm a bit late to the game, but I have a question: why should this be
> > keyed to the *root* uid of the namespace in particular? Certainly if
> > user foo trusts the cap bits on some file, then user foo might trust
> > those caps to be exerted over any namespace that user foo owns, since
> > user foo owns the namespace.
>
> ... Tying it to a kuid which represents the userns->owner of any
> namespace in which the capability will be honored might be fine
> with me. Is that what you mean? So if uid 1000 creates a userns
> mapping uids 100000-200000, and 100000 in that container puts X=pe
> on /bin/foo, uid 101000 in that container runs /bin/foo with privilege
> X. Uid 101000 in someone else's container does not.
>
> Although, if I create two containers and provide them different
> uidmaps, it may well be because I want them segragated and want
> to minimize the changes of one container breaking out into the
> other. This risks breaking that.
Thinking differently now... I really want it to "just work" to tar
and untar these. So I'm thinking of simply using the file owner
as the uid. So to write a security.ns_capability xattr, you must
be uid 0 in the inode's namespace, the file must be owned by uid 0,
and the capabilities in the xattr will be honored for any namespace
where in that uid_t 0 is root.
Does that sound overly restrictive? I expect file capabilities to
be used on files owned by root but not setuid-root, so I think it
is ok.
-serge
WARNING: multiple messages have this Message-ID (diff)
From: "Serge E. Hallyn" <serge@hallyn.com>
To: "Serge E. Hallyn" <serge.hallyn@ubuntu.com>
Cc: Andy Lutomirski <luto@amacapital.net>, Jann Horn <jann@thejh.net>,
"Serge E. Hallyn" <serge@hallyn.com>,
"Eric W. Biederman" <ebiederm@xmission.com>,
lkml <linux-kernel@vger.kernel.org>,
Andrew Morgan <morgan@kernel.org>,
LXC development mailing-list
<lxc-devel@lists.linuxcontainers.org>,
Richard Weinberger <richard@nod.at>,
LSM <linux-security-module@vger.kernel.org>,
Linux API <linux-api@vger.kernel.org>,
Kees Cook <keescook@chromium.org>,
Christian Brauner <christian.brauner@mailbox.org>
Subject: Re: [PATCH RFC] Introduce new security.nscapability xattr
Date: Mon, 29 Feb 2016 15:38:20 -0600 [thread overview]
Message-ID: <20160229213820.GA1215@mail.hallyn.com> (raw)
In-Reply-To: <20160129073151.GA23156@mail.hallyn.com>
On Fri, Jan 29, 2016 at 01:31:51AM -0600, Serge E. Hallyn wrote:
> On Wed, Jan 27, 2016 at 04:36:02PM -0800, Andy Lutomirski wrote:
> > On Wed, Jan 27, 2016 at 9:22 AM, Jann Horn <jann@thejh.net> wrote:
> > > I think it sounds good from a security perspective.
> >
> > I'm a bit late to the game, but I have a question: why should this be
> > keyed to the *root* uid of the namespace in particular? Certainly if
> > user foo trusts the cap bits on some file, then user foo might trust
> > those caps to be exerted over any namespace that user foo owns, since
> > user foo owns the namespace.
>
> ... Tying it to a kuid which represents the userns->owner of any
> namespace in which the capability will be honored might be fine
> with me. Is that what you mean? So if uid 1000 creates a userns
> mapping uids 100000-200000, and 100000 in that container puts X=pe
> on /bin/foo, uid 101000 in that container runs /bin/foo with privilege
> X. Uid 101000 in someone else's container does not.
>
> Although, if I create two containers and provide them different
> uidmaps, it may well be because I want them segragated and want
> to minimize the changes of one container breaking out into the
> other. This risks breaking that.
Thinking differently now... I really want it to "just work" to tar
and untar these. So I'm thinking of simply using the file owner
as the uid. So to write a security.ns_capability xattr, you must
be uid 0 in the inode's namespace, the file must be owned by uid 0,
and the capabilities in the xattr will be honored for any namespace
where in that uid_t 0 is root.
Does that sound overly restrictive? I expect file capabilities to
be used on files owned by root but not setuid-root, so I think it
is ok.
-serge
next prev parent reply other threads:[~2016-02-29 21:38 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-30 22:43 [PATCH RFC] Introduce new security.nscapability xattr Serge E. Hallyn
[not found] ` <20151130224356.GA27972-7LNsyQBKDXoIagZqoN9o3w@public.gmane.org>
2015-11-30 23:08 ` Eric W. Biederman
2015-11-30 23:08 ` Eric W. Biederman
[not found] ` <87two3w0el.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2015-12-01 3:51 ` Serge E. Hallyn
2015-12-01 3:51 ` Serge E. Hallyn
2015-12-04 20:21 ` Serge E. Hallyn
2016-01-19 7:09 ` Serge E. Hallyn
2016-01-20 12:48 ` Jann Horn
2016-01-27 16:08 ` Serge E. Hallyn
2016-01-27 17:22 ` Jann Horn
[not found] ` <20160127172225.GA7967-J1fxOzX/cBvk1uMJSBkQmQ@public.gmane.org>
2016-01-28 0:36 ` Andy Lutomirski
2016-01-28 0:36 ` Andy Lutomirski
2016-01-29 7:31 ` Serge E. Hallyn
[not found] ` <20160129073151.GA23156-7LNsyQBKDXoIagZqoN9o3w@public.gmane.org>
2016-02-29 21:38 ` Serge E. Hallyn [this message]
2016-02-29 21:38 ` Serge E. Hallyn
[not found] ` <20160229213820.GA1215-7LNsyQBKDXoIagZqoN9o3w@public.gmane.org>
2016-03-02 0:00 ` Serge E. Hallyn
2016-03-02 0:00 ` Serge E. Hallyn
2016-01-20 12:14 ` Jann Horn
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=20160229213820.GA1215@mail.hallyn.com \
--to=serge-a9i7lubdfnhqt0dzr+alfa@public.gmane.org \
--cc=christian.brauner-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org \
--cc=ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org \
--cc=jann-XZ1E9jl8jIdeoWH0uzbU5w@public.gmane.org \
--cc=keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-security-module-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org \
--cc=lxc-devel-cunTk1MwBs9qMoObBWhMNEqPaTDuhLve2LY78lusg7I@public.gmane.org \
--cc=morgan-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=richard-/L3Ra7n9ekc@public.gmane.org \
--cc=serge.hallyn-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org \
/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.