From: Chris Wright <chrisw@sous-sol.org>
To: Dave Quigley <dpquigl@tycho.nsa.gov>
Cc: Chris Wright <chrisw@sous-sol.org>,
sds@tycho.nsa.gov, jmorris@namei.org, casey@schaufler-ca.com,
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 16:10:13 -0800 [thread overview]
Message-ID: <20080305001013.GF4416@sequoia.sous-sol.org> (raw)
In-Reply-To: <1204673709.14520.141.camel@moss-terrapins.epoch.ncsc.mil>
* Dave Quigley (dpquigl@tycho.nsa.gov) wrote:
>
> On Tue, 2008-03-04 at 15:52 -0800, Chris Wright wrote:
> > * Dave Quigley (dpquigl@tycho.nsa.gov) wrote:
> > > 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. 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.
> >
> > Can you work on a couple things..first the fn name is not particularly
> > helpful ({get,set}context are just vague), and second, the SELinux
> > implementation is far too close to VFS code (you should not be manually
> > calling fsnotify, for example). IOW, it looks more like a higher
> > level helper.
>
> Is James' suggestion of getsecctx and setsecctx better or would you
> prefer another name?
Mainly capturing that it's doing this to a file not another object.
> The code for the selinux hook is taken from
> vfs_setxattr. The issue is that we are going to be doing some VFSish
> things in there. We are going to take a string and break it into zero or
> more xattr calls (in SELinux's case it is only one). I guess we could
> just set the xattr and then rely on the caller of this function to call
> fsnotify.
Yes, can we formalize this? the xattr_security code could be cleaned
up if you need better helpers in VFS.
BTW, this is unnecessary after cut 'n paste:
+ rc = -EOPNOTSUPP; <-- superfluous (and err works better for "if (!err)")
+ if (inode->i_op->setxattr) {
+ rc = inode->i_op->setxattr(dentry, XATTR_NAME_SELINUX, ctx, ctxlen, 0);
...
+ } else {
+ rc = security_inode_setsecurity(inode, XATTR_SELINUX_SUFFIX, ctx,
thanks,
-chris
--
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.
next prev parent reply other threads:[~2008-03-05 0:10 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-04 21:53 [PATCH 1/1] LSM/SELinux: {get,set}context hooks to access LSM security context information 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 [this message]
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
-- 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-05 1:08 Casey Schaufler
2008-03-05 13:41 ` Dave Quigley
2008-03-05 14:08 ` Stephen Smalley
2008-03-05 17:24 ` 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=20080305001013.GF4416@sequoia.sous-sol.org \
--to=chrisw@sous-sol.org \
--cc=casey@schaufler-ca.com \
--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.