From: David Howells <dhowells@redhat.com>
To: casey@schaufler-ca.com
Cc: dhowells@redhat.com, viro@ftp.linux.org.uk, hch@infradead.org,
Trond.Myklebust@netapp.com, sds@tycho.nsa.gov,
linux-kernel@vger.kernel.org, selinux@tycho.nsa.gov,
linux-security-module@vger.kernel.org
Subject: Re: [PATCH 2/3] CRED: Split the task security data and move part of it into struct cred
Date: Wed, 19 Sep 2007 23:57:16 +0100 [thread overview]
Message-ID: <6741.1190242636@redhat.com> (raw)
In-Reply-To: <843863.97817.qm@web36611.mail.mud.yahoo.com>
Casey Schaufler <casey@schaufler-ca.com> wrote:
> > Move into the cred struct the part of the task security data that defines
> > how a task acts upon an object. The part that defines how something acts
> > upon a task remains attached to the task.
>
> This seems to me to be an unnatural and inappropriate separation. Move the
> whole of the security blob into the cred if you must have a cred (which I
> was soooo glad Linux didn't have after having dealt with it in Solaris)
> rather than having two blobs to deal with.
The separation is necessary for a few reasons:
(1) The task victimisation context must *not* be changed by a temporary
override of the action and creation contexts for purposes such as
cachefiles.
(2) If the victimisation context is not included in the override cred, then I
only need one copy of the override cred to do *all* the work for
cachefiles. I can share that singular override blob across every task
that wishes to access the cache.
(3) If the victimisation context is moved to the override cred, I have to
create a new context every time I want to apply the override. This means
I have to deal with the possibility of OOM at such points. I could cache
the contexts, but that's messy - and unnecessary.
> If an LSM requires a different treatment between when a task is a subject and
> when it is an object the LSM should handle that itself.
Indeed, but I can help it to do so by providing separate security pointers on
the task struct and the cred struct.
> So put all these fields into one blob and attach them to the cred.
The separation is, I think, the correct thing to do.
> Actually, if you put all these fields in the task blob maybe you
> don't need to do your COW thing at all.
Whilst that is true, one of the purposes of this is to make it easier and
cleaner to effect the override. Every field in the cred struct potentially
must be overridden. That's a lot of context to save each time I need to apply
the override and a lot of context to restore each time I want to restore it.
With these patches, all I need to do is to take a ref and swap the cred
pointers with a memory barrier to satisfy the RCU, and then swap them back
again and release the ref. It's much, much simpler.
Furthermore, with respect to LSM and SELinux, I think I can remove the SELinux
specific knowledge currently present in cachefiles by saying to LSM "give me a
cred for kernel service X". With SELinux this can do all the transformations
necessary to give me the appropriate action SID and file creation SID without
me needing to know that these concepts exist. I just apply the cred I'm given
as an override.
With your suggestion, I either have to do a full set of transformations each
time I want to apply the override, or I have to know about SELinux or
whatever's internals. Your objection to my earlier patch was this very point.
David
next prev parent reply other threads:[~2007-09-19 22:58 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-19 16:17 [PATCH 0/3] Introduce credential record David Howells
2007-09-19 16:17 ` [PATCH 1/3] CRED: Introduce a COW credentials record David Howells
2007-09-19 16:18 ` [PATCH 2/3] CRED: Split the task security data and move part of it into struct cred David Howells
2007-09-19 17:28 ` Casey Schaufler
2007-09-19 22:57 ` David Howells [this message]
2007-09-20 16:31 ` Casey Schaufler
2007-09-20 17:17 ` David Howells
2007-09-20 17:33 ` David Howells
2007-09-24 14:00 ` Serge E. Hallyn
2007-09-24 14:21 ` Stephen Smalley
2007-09-24 15:35 ` Serge E. Hallyn
2007-09-24 15:52 ` David Howells
2007-09-26 13:30 ` David Howells
2007-09-26 14:14 ` Stephen Smalley
2007-09-26 14:58 ` Casey Schaufler
2007-09-19 16:18 ` [PATCH 3/3] CRED: Move the effective capabilities into the cred struct David Howells
2007-09-20 4:11 ` Andrew Morgan
2007-09-20 8:15 ` David Howells
2007-09-20 13:38 ` Trond Myklebust
2007-09-20 15:36 ` Casey Schaufler
2007-09-20 16:09 ` Trond Myklebust
2007-09-26 18:23 ` Al Viro
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=6741.1190242636@redhat.com \
--to=dhowells@redhat.com \
--cc=Trond.Myklebust@netapp.com \
--cc=casey@schaufler-ca.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=sds@tycho.nsa.gov \
--cc=selinux@tycho.nsa.gov \
--cc=viro@ftp.linux.org.uk \
/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