From: Stephen Smalley <sds@tycho.nsa.gov>
To: HarryCiao <harrytaurus2002@hotmail.com>
Cc: qingtao.cao@windriver.com, jmorris@namei.org,
eparis@parisplace.org,
selinux-mailing-list <selinux@tycho.nsa.gov>
Subject: RE: [v0 PATCH 2/3] SELinux: Compute role in newcontext for all classes
Date: Thu, 24 Mar 2011 09:25:26 -0400 [thread overview]
Message-ID: <1300973126.8157.31.camel@moss-pluto> (raw)
In-Reply-To: <SNT139-w5684DB5D9F65F017A51374ABB60@phx.gbl>
On Thu, 2011-03-24 at 09:56 +0000, HarryCiao wrote:
> Hi Stephen,
>
> > Subject: Re: [v0 PATCH 2/3] SELinux: Compute role in newcontext for
> all classes
> > From: sds@tycho.nsa.gov
> > To: qingtao.cao@windriver.com
> > CC: jmorris@namei.org; eparis@parisplace.org; selinux@tycho.nsa.gov
> > Date: Wed, 23 Mar 2011 09:31:52 -0400
> >
> > On Wed, 2011-03-23 at 10:28 +0800, Harry Ciao wrote:
> > > From: Harry Ciao <harrytaurus200@hotmail.com>
> > >
> > > For the process class, the role_trans.type is compared with
> > > tcontext->type, that is, the program executable type.
> > >
> > > For all the rest classes, the role_trans.type is compared with
> > > newcontext.type, that is, the type for the newly created object
> > > of that class.
> >
> > I don't understand why you aren't applying the logic consistently
> for
> > all classes. Compare with range_trans handling. Also, if we think
> > there will be any significant numbe! r of these role_trans rules,
> you
> > might want to go ahead and start using a hashtab as was later done
> for
> > range_trans for efficient lookup.
>
> Suppose we have below role_transition rule:
>
> role_transition sysadm_r user_home_t : dir sysadm_r;
>
> If roletr->type compared with newcontext.type, then it means that if
> sysadm_r is creating an directory object with type equals to
> user_home_t, then the directory object will have a role of sysadm_r.
>
> However, if roletr->type is compared with tcontext->type, then the
> semantics would be changed to that any objects of any class created by
> sysadm_r in a directory object of the user_home_t type would have
> their role set to sysadm_r, since in selinux_inode_init_security(),
> dir->i_security is passed as tsid always.
>
> I guess the former approach could have much refined control on the
> objects role, if objects are of different types, then they could
> assume different roles, not necessarily all f! iles in one directory
> have to share the same role.
>
> What you thi nk?
Compare with type_transition or range_transition semantics.
type_transition sysadm_t tmp_t : sock_file sysadm_tmp_t;
means when a sysadm_t (scontext->type) process creates a socket file
(tclass) object in a directory labeled tmp_t (tcontext->type), then
label the socket file with sysadm_tmp_t (newcontext->type).
type_transition sysadm_t sshd_exec_t:process sshd_t;
means when a sysadm_t (scontext->type) process executes a sshd_exec_t
(tcontext->type) file, then label the new process (tclass) with sshd_t
(newcontext->type).
See how they are consistently applied regardless of whether it is a
process or object class?
--
Stephen Smalley
National Security Agency
--
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:[~2011-03-24 13:25 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-23 2:28 v0 Add class support to the role_transition rule Harry Ciao
2011-03-23 2:28 ` [v0 PATCH 1/3] SELinux: Add class support to the role_trans structure Harry Ciao
2011-03-23 14:40 ` Eric Paris
2011-03-24 9:43 ` HarryCiao
2011-03-24 13:21 ` Stephen Smalley
2011-03-25 6:28 ` HarryCiao
2011-03-23 2:28 ` [v0 PATCH 2/3] SELinux: Compute role in newcontext for all classes Harry Ciao
2011-03-23 13:31 ` Stephen Smalley
2011-03-24 9:56 ` HarryCiao
2011-03-24 13:25 ` Stephen Smalley [this message]
2011-03-25 6:25 ` HarryCiao
2011-03-23 14:46 ` Eric Paris
2011-03-23 2:28 ` [v0 PATCH 3/3] SELinux: Write class field in role_trans_write Harry Ciao
2011-03-23 14:48 ` Eric Paris
2011-03-23 18:59 ` Joshua Brindle
2011-03-24 10:02 ` HarryCiao
2011-03-23 2:28 ` [v0 PATCH 1/5] Add class to role_trans & role_trans_rule Harry Ciao
2011-03-23 2:28 ` [v0 PATCH 2/5] Make role_transition parser to handle class field Harry Ciao
2011-03-23 19:30 ` Eric Paris
2011-03-23 19:41 ` Joshua Brindle
2011-03-23 20:14 ` Eric Paris
2011-03-23 2:28 ` [v0 PATCH 3/5] Handle the class in role_trans structure Harry Ciao
2011-03-23 13:26 ` Joshua Brindle
2011-03-23 19:05 ` Joshua Brindle
2011-03-24 10:36 ` HarryCiao
2011-03-23 2:28 ` [v0 PATCH 4/5] Handle the class in role_trans_rule structure Harry Ciao
2011-03-23 2:28 ` [v0 PATCH 5/5] Display the class in role_transition rule Harry Ciao
2011-03-23 8:21 ` v0 Add class support to the " Harry Ciao
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=1300973126.8157.31.camel@moss-pluto \
--to=sds@tycho.nsa.gov \
--cc=eparis@parisplace.org \
--cc=harrytaurus2002@hotmail.com \
--cc=jmorris@namei.org \
--cc=qingtao.cao@windriver.com \
--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.