All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Smalley <sds@tycho.nsa.gov>
To: "Roberts, William C" <william.c.roberts@intel.com>,
	Casey Schaufler <casey@schaufler-ca.com>,
	Paul Moore <paul@paul-moore.com>
Cc: Daniel Cashman <dcashman@android.com>,
	"selinux@tycho.nsa.gov" <selinux@tycho.nsa.gov>,
	Eric Paris <eparis@parisplace.org>,
	James Morris <james.l.morris@oracle.com>,
	"serge@hallyn.com" <serge@hallyn.com>,
	"linux-security-module@vger.kernel.org"
	<linux-security-module@vger.kernel.org>,
	"jeffv@google.com" <jeffv@google.com>,
	"nnk@google.com" <nnk@google.com>,
	"arve@google.com" <arve@google.com>
Subject: Re: Exposing secid to secctx mapping to user-space
Date: Mon, 14 Dec 2015 17:11:25 -0500	[thread overview]
Message-ID: <566F3E8D.3060604@tycho.nsa.gov> (raw)
In-Reply-To: <476DC76E7D1DF2438D32BFADF679FC56011AD188@ORSMSX103.amr.corp.intel.com>

On 12/14/2015 04:29 PM, Roberts, William C wrote:
> <snip>
>> Subject: Re: Exposing secid to secctx mapping to user-space
>>
>> On 12/13/2015 2:06 PM, Paul Moore wrote:
>>> On Friday, December 11, 2015 05:14:38 PM Stephen Smalley wrote:
>>>> Perhaps we could provide a new fixed-size tokenized version of the
>>>> security context string for export to userspace that could be
>>>> embedded in the binder transaction structure?  This could avoid both
>>>> the limitations of the current secid (e.g. limited to 32 bits, no
>>>> stackability) and the overhead of copying context strings on every IPC.
>>> On Friday, December 11, 2015 04:24:48 PM Casey Schaufler wrote:
>>>> How about this: Provide an alias mechanism for secctx. There would
>>>> then be a secid (32bits) a secctx (arbitrary text string) and a
>>>> secalias which could be a limited string of some length. You could
>>>> use the alias in place of the secctx anywhere you liked.
>>> My initial reaction to the secalias idea isn't overly positive.  It
>>> seems like a kludge with a lot of duplication, both in terms of code
>>> and concept, and a lot of risk for confusion both by users and policy
>>> writers.  I think if we really wanted to limit the security label
>>> string format to a small size we should have done that from the start, it's too
>> late now.
>>
>> The alias would be a user space controlled mapping. The kernel code would only
>> be involved at the border. I would never expect policy to be written using aliases.
>> As for being a kludge, yeah, there's some of that, but I think that's true with the
>> secid, too.
>>
>>> Assuming we see some binder performance numbers, and the numbers are
>>> bad, I'm a little more open to doing something with the secid token.
>>> Up to this point we haven't made any guarantees about the token and we
>>> haven't exported it outside the kernel so there is some ability to change it to fit
>> our needs.
>>> Granted, this isn't perfect solution either, and perhaps ultimately we
>>> would need something else, but I think it is worth looking into this
>>> first before we introduce another string label.
>>
>> I agree with getting numbers before someone dashes off to make a premature
>> optimization that exposes secids. If the numbers are bad I would hope that the
>> developers would look at fixing binder rather than exposing (and forever
>> requiring) secids.
>>
>
> If I understand correctly, the goal here is to avoid the lookup from pid to context. If we somehow
> Had the context or a token to a context during the ipc transaction to userspace, we could just use that
> In computing the access decision. If that is correct, then since we have PID, why not just extend the
> SE Linux compute av decision interface to support passing of PID and then it can do the lookup in the
> Kernel?

That's no less racy than getpidcon().

  reply	other threads:[~2015-12-14 22:11 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-11 18:37 Exposing secid to secctx mapping to user-space Daniel Cashman
2015-12-11 19:55 ` Paul Moore
2015-12-11 20:41   ` Roberts, William C
2015-12-11 22:14   ` Stephen Smalley
2015-12-12  0:24     ` Casey Schaufler
2015-12-13 22:06     ` Paul Moore
2015-12-14 17:03       ` Mike Palmiotto
2015-12-14 17:31         ` Casey Schaufler
2015-12-14 17:42         ` Stephen Smalley
2015-12-14 17:50       ` Casey Schaufler
2015-12-14 21:29         ` Roberts, William C
2015-12-14 22:11           ` Stephen Smalley [this message]
2015-12-14 22:52             ` William Roberts
2015-12-14 22:57             ` Roberts, William C
2015-12-15 15:00               ` Stephen Smalley
2015-12-15 16:06                 ` Casey Schaufler
2015-12-15 16:55                   ` Stephen Smalley
2015-12-15 17:36                     ` Casey Schaufler
2015-12-15 17:19                   ` Joe Nall
2015-12-15 18:03                     ` Stephen Smalley
2015-12-15 19:09                       ` Joe Nall
2015-12-18 23:55                         ` Paul Moore
2015-12-15 20:58                 ` Daniel Cashman
2015-12-15 22:41                   ` William Roberts
2015-12-18 23:54                   ` Paul Moore
2015-12-11 20:36 ` Casey Schaufler

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=566F3E8D.3060604@tycho.nsa.gov \
    --to=sds@tycho.nsa.gov \
    --cc=arve@google.com \
    --cc=casey@schaufler-ca.com \
    --cc=dcashman@android.com \
    --cc=eparis@parisplace.org \
    --cc=james.l.morris@oracle.com \
    --cc=jeffv@google.com \
    --cc=linux-security-module@vger.kernel.org \
    --cc=nnk@google.com \
    --cc=paul@paul-moore.com \
    --cc=selinux@tycho.nsa.gov \
    --cc=serge@hallyn.com \
    --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.