All of lore.kernel.org
 help / color / mirror / Atom feed
From: Casey Schaufler <casey@schaufler-ca.com>
To: Dave Quigley <dpquigl@tycho.nsa.gov>, Chris Wright <chrisw@sous-sol.org>
Cc: sds@tycho.nsa.gov, jmorris@namei.org,
	linux-security-module@vger.kernel.org, selinux@tycho.nsa.gov
Subject: Re: [PATCH 1/1] LSM/SELinux: {get,set}context hooks to access LSM security context information.
Date: Tue, 4 Mar 2008 17:08:43 -0800 (PST)	[thread overview]
Message-ID: <515206.47792.qm@web36604.mail.mud.yahoo.com> (raw)


----- Original Message ----
> From: Dave Quigley <dpquigl@tycho.nsa.gov>
> To: Chris Wright <chrisw@sous-sol.org>
> Cc: sds@tycho.nsa.gov; jmorris@namei.org; casey@schaufler-ca.com; linux-security-module@vger.kernel.org; selinux@tycho.nsa.gov
> Sent: Tuesday, March 4, 2008 3:07:06 PM
> Subject: Re: [PATCH 1/1] LSM/SELinux: {get,set}context hooks to access LSM security context information.
> 
> 
> On Tue, 2008-03-04 at 15:26 -0800, Chris Wright wrote:
> > * David P. Quigley (dpquigl@tycho.nsa.gov) wrote:
> > > +/* Flags for setcontext */
> > > +#define LSM_SETCORE 1
> > > +#define LSM_SETDISK 2
> > > +
> > > #ifdef CONFIG_SECURITY
> > > 
> > > /**
> > > @@ -1395,6 +1399,9 @@ struct security_operations {
> > > int (*secctx_to_secid)(char *secdata, u32 seclen, u32 *secid);
> > > void (*release_secctx)(char *secdata, u32 seclen);
> > > 
> > > + int (*setcontext)(struct dentry *dentry, void *ctx, u32 ctxlen, int 
> flags);
> > > + int (*getcontext)(struct dentry *dentry, void **ctx, u32 *ctxlen);
> > 
> > Is this meant to address Casey's argument about the mac label hook name?
> > Also, why have you made the distinction of in-core vs. on disk in the
> > interface? As I mentioned, I think just needs a little better
> > description of why.
> > 
> > thanks,
> > -chris
> 
> The reason for the differentiation is that NFS inodes don't need their
> on-disk representation set. Normally this would be taken care of with an
> inode_getsecurity call but as you noted Casey objected to a hook to get
> the suffix name.

No, I objected to a hook that is specific to MAC LSMs that
store a single label as an xattr. I objected to it because it
was being used to support one file system on one LSM and
suggested that for that reason it should be an interface
private to either the specific LSM or the specific filesystem.

> Also he did have a point in that the context may have
> several components to it that could have multiple suffixes. So I need a
> hook that allows us to set possibly multiple internal security values
> based on a security context and without using an xattr name.

You could use Ahmed's hook to get the secid of a file and then
use secid_to_secctx to get the context. That's what audit has to
do.


Casey Schaufler
casey@schaufler-ca.com 

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

             reply	other threads:[~2008-03-05  1:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-05  1:08 Casey Schaufler [this message]
2008-03-05 13:41 ` [PATCH 1/1] LSM/SELinux: {get,set}context hooks to access LSM security context information Dave Quigley
2008-03-05 14:08 ` Stephen Smalley
2008-03-05 17:24   ` Casey Schaufler
  -- strict thread matches above, loose matches on Subject: below --
2008-03-04 22:53 Casey Schaufler
2008-03-04 22:33 ` Dave Quigley
2008-03-04 23:14   ` Chris Wright
2008-03-04 22:51     ` Dave Quigley
2008-03-04 22:59       ` Dave Quigley
2008-03-04 21:53 David P. Quigley
2008-03-04 22:21 ` Dave Quigley
2008-03-04 23:26 ` Chris Wright
2008-03-04 23:07   ` Dave Quigley
2008-03-04 23:52     ` Chris Wright
2008-03-04 23:35       ` Dave Quigley
2008-03-05  0:10         ` Chris Wright
2008-03-04 23:59           ` Dave Quigley
2008-03-05  0:31             ` James Morris
2008-03-05  1:39             ` Chris Wright
2008-03-04 23:48 ` James Morris
2008-03-04 23:26   ` Dave Quigley

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=515206.47792.qm@web36604.mail.mud.yahoo.com \
    --to=casey@schaufler-ca.com \
    --cc=chrisw@sous-sol.org \
    --cc=dpquigl@tycho.nsa.gov \
    --cc=jmorris@namei.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@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 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.