linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: "Serge E. Hallyn" <serge@hallyn.com>
Cc: Casey Schaufler <casey@schaufler-ca.com>,
	Amir Goldstein <amir73il@gmail.com>,
	Stefan Berger <stefanb@linux.vnet.ibm.com>,
	Linux Containers <containers@lists.linux-foundation.org>,
	lkp@01.org, xiaolong.ye@intel.com,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Mimi Zohar <zohar@linux.vnet.ibm.com>,
	Tycho Andersen <tycho@docker.com>,
	James Bottomley <James.Bottomley@hansenpartnership.com>,
	christian.brauner@mailbox.org, Vivek Goyal <vgoyal@redhat.com>,
	LSM List <linux-security-module@vger.kernel.org>
Subject: Re: [PATCH 0/3] Enable namespaced file capabilities
Date: Fri, 23 Jun 2017 12:49:59 -0500	[thread overview]
Message-ID: <8760fmh9vc.fsf@xmission.com> (raw)
In-Reply-To: <20170623170108.GA19354@mail.hallyn.com> (Serge E. Hallyn's message of "Fri, 23 Jun 2017 12:01:08 -0500")

"Serge E. Hallyn" <serge@hallyn.com> writes:

> Quoting Casey Schaufler (casey@schaufler-ca.com):
>> On 6/23/2017 9:30 AM, Serge E. Hallyn wrote:
>> > Quoting Casey Schaufler (casey@schaufler-ca.com):
>> >> Or maybe just security.ns.capability, taking James' comment into account.
>> > That last one may be suitable as an option, useful for his particular
>> > (somewhat barbaric :) use case, but it's not ok for the general solution.
>> 
>> security.ns@uid=100.capability
>
> I'm ok with this.  It gives protection from older kernels, and puts
> the 'ns@uid=' at predictable locations for security and trusted.
>
>> It makes the namespace part explicit and separate from
>> the rest of the attribute name. It also generalizes for
>> other attributes.
>> 
>> security.ns@uid=1000@smack=WestOfOne.SMACK64
>
> Looks good to me.
>
> Do we want to say that '.' ends the attribute list?  That of
> course means '.' cannot be in the attributes.  Perhaps end
> with '@@' instead?  Just a thought.
>
> What do others think?

I think we have two things that will limit the allowed attributes
severely.

1) We need to the names of all of the xattrs when mounting a filesystem
   with s_user_ns != &init_user_ns.  I haven't yet checked the patches
   to see if they do this properly.

2) Names of xattrs are not fully general and filesystems perform various
   tricks to encode them more densely.  We should see what the games
   with xattr names do to how densely xattrs can be stored on disk.
   That matters.

Putting the uid of the root user in the name sounds fundamental to doing
things this way.  I am not at all certain about putting smack labels and
generally treating this as something we can add two arbitrarily.

If nothing else this reminds me of the frequent problem in
certifications with ouids.  Arbitrary attributes tend to defeat parsers
in a security context on a regular basis.  Even the kernel command line
parser has seen problems in this area, and it isn't security sensitive
most of the time.

Extensibility is good in the abstract long term sense.  Extensibility in
the here and now where we don't even know which attributes we are
talking about scares me.  I don't see how we can possibily know with
multiple attributes which xattrs will be the one to use.  As we won't
even know which properties of the kernel to look at to match attributes.

So while I don't mind reorganizing the order we put the information into
the attribute.  Let's keep what we place in there very specific.

Eric

  reply	other threads:[~2017-06-23 17:57 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-22 18:59 [PATCH 0/3] Enable namespaced file capabilities Stefan Berger
2017-06-22 18:59 ` [PATCH 1/3] xattr: Enable security.capability in user namespaces Stefan Berger
2017-06-24 21:02   ` kbuild test robot
2017-06-24 21:02   ` [PATCH] xattr: fix kstrdup.cocci warnings kbuild test robot
2017-06-22 18:59 ` [PATCH 2/3] Enable capabilities of files from shared filesystem Stefan Berger
2017-06-22 18:59 ` [PATCH 3/3] Enable security.selinux in user namespaces Stefan Berger
2017-06-23 20:30   ` Stephen Smalley
2017-06-23 23:41     ` Stefan Berger
2017-06-22 19:59 ` [PATCH 0/3] Enable namespaced file capabilities Casey Schaufler
2017-06-22 20:12   ` Stefan Berger
2017-06-22 20:33     ` Casey Schaufler
2017-06-22 21:03       ` Stefan Berger
2017-06-22 21:09       ` Serge E. Hallyn
2017-06-22 22:40         ` Casey Schaufler
2017-06-22 23:07           ` Serge E. Hallyn
2017-06-22 23:29 ` James Bottomley
2017-06-22 23:32   ` Serge E. Hallyn
2017-06-22 23:36   ` Serge E. Hallyn
2017-06-23  0:13     ` James Bottomley
2017-06-23  1:19       ` Serge E. Hallyn
2017-06-23 17:37       ` Eric W. Biederman
2017-06-23 18:39         ` Serge E. Hallyn
2017-06-23  7:01 ` Amir Goldstein
2017-06-23 16:00   ` Serge E. Hallyn
2017-06-23 16:16     ` Casey Schaufler
2017-06-23 16:30       ` Serge E. Hallyn
2017-06-23 16:53         ` Casey Schaufler
2017-06-23 17:01           ` Serge E. Hallyn
2017-06-23 17:49             ` Eric W. Biederman [this message]
2017-06-23 18:32               ` Serge E. Hallyn
2017-06-23 17:07         ` James Bottomley
2017-06-23 17:20           ` Serge E. Hallyn
2017-06-23 17:38           ` Stefan Berger
2017-06-23 18:34             ` Serge E. Hallyn
2017-06-23 18:08       ` Stefan Berger
2017-06-23 18:35         ` Serge E. Hallyn
2017-06-23 20:30           ` Casey Schaufler
2017-06-23 23:09           ` Stefan Berger
2017-06-23 23:51             ` Casey Schaufler
2017-06-28  5:41   ` Serge E. Hallyn
2017-06-28  7:18     ` Amir Goldstein
2017-06-28 14:04       ` Stefan Berger
2017-06-28 14:28       ` Serge E. Hallyn
2017-06-23 20:09 ` Vivek Goyal
2017-06-23 20:17   ` Serge E. Hallyn
2017-06-23 20:36     ` Vivek Goyal
2017-06-23 20:51       ` Serge E. Hallyn

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=8760fmh9vc.fsf@xmission.com \
    --to=ebiederm@xmission.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=amir73il@gmail.com \
    --cc=casey@schaufler-ca.com \
    --cc=christian.brauner@mailbox.org \
    --cc=containers@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=lkp@01.org \
    --cc=serge@hallyn.com \
    --cc=stefanb@linux.vnet.ibm.com \
    --cc=tycho@docker.com \
    --cc=vgoyal@redhat.com \
    --cc=xiaolong.ye@intel.com \
    --cc=zohar@linux.vnet.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).