All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Smalley <sds@tycho.nsa.gov>
To: Harry Ciao <qingtao.cao@windriver.com>
Cc: jmorris@namei.org, eparis@parisplace.org, selinux@tycho.nsa.gov
Subject: Re: [v2 PATCH 3/3] SELinux: Write class field in role_trans_write.
Date: Fri, 25 Mar 2011 12:50:36 -0400	[thread overview]
Message-ID: <1301071836.22099.22.camel@moss-pluto> (raw)
In-Reply-To: <1301032323-20363-6-git-send-email-qingtao.cao@windriver.com>

On Fri, 2011-03-25 at 13:52 +0800, Harry Ciao wrote:
> If kernel policy version is >= 26, then write the class field of the
> role_trans structure into the binary reprensentation.
> 
> Signed-off-by: Harry Ciao <qingtao.cao@windriver.com>

Acked-by:  Stephen Smalley <sds@tycho.nsa.gov>

for the 3 kernel patches.

> ---
>  security/selinux/ss/policydb.c |   11 +++++++++--
>  1 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c
> index fd62c50..a493eae 100644
> --- a/security/selinux/ss/policydb.c
> +++ b/security/selinux/ss/policydb.c
> @@ -2535,8 +2535,9 @@ static int cat_write(void *vkey, void *datum, void *ptr)
>  	return 0;
>  }
>  
> -static int role_trans_write(struct role_trans *r, void *fp)
> +static int role_trans_write(struct policydb *p, void *fp)
>  {
> +	struct role_trans *r = p->role_tr;
>  	struct role_trans *tr;
>  	u32 buf[3];
>  	size_t nel;
> @@ -2556,6 +2557,12 @@ static int role_trans_write(struct role_trans *r, void *fp)
>  		rc = put_entry(buf, sizeof(u32), 3, fp);
>  		if (rc)
>  			return rc;
> +		if (p->policyvers >= POLICYDB_VERSION_ROLETRANS) {
> +			buf[0] = cpu_to_le32(tr->tclass);
> +			rc = put_entry(buf, sizeof(u32), 1, fp);
> +			if (rc)
> +				return rc;
> +		}
>  	}
>  
>  	return 0;
> @@ -3267,7 +3274,7 @@ int policydb_write(struct policydb *p, void *fp)
>  	if (rc)
>  		return rc;
>  
> -	rc = role_trans_write(p->role_tr, fp);
> +	rc = role_trans_write(p, fp);
>  	if (rc)
>  		return rc;
>  

-- 
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.

  reply	other threads:[~2011-03-25 16:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-25  5:51 v2 Add class support to the role_transition rule Harry Ciao
2011-03-25  5:51 ` [v2 PATCH 1/3] SELinux: Add class support to the role_trans structure Harry Ciao
2011-04-06 23:04   ` Eric Paris
2011-04-07  3:00     ` Harry Ciao
2011-03-25  5:51 ` [v2 PATCH 1/5] Userspace: add class to role_trans & role_trans_rule Harry Ciao
2011-03-25  5:51 ` [v2 PATCH 2/3] SELinux: Compute role in newcontext for all classes Harry Ciao
2011-03-25  5:51 ` [v2 PATCH 2/5] Userspace: role_transition parser to handle class field Harry Ciao
2011-03-25  5:52 ` [v2 PATCH 3/3] SELinux: Write class field in role_trans_write Harry Ciao
2011-03-25 16:50   ` Stephen Smalley [this message]
2011-03-28 18:30     ` Eric Paris
2011-03-25  5:52 ` [v2 PATCH 3/5] Userspace: handle the class field in role_trans struct Harry Ciao
2011-03-25  5:52 ` [v2 PATCH 4/5] Userspace: handle the class in role_trans_rule Harry Ciao
2011-03-25  5:52 ` [v2 PATCH 5/5] Userspace: display the class in role_transition rule Harry Ciao
2011-03-28 21:28   ` Joshua Brindle
2011-04-12 17:43   ` Daniel J Walsh
2011-04-12 18:03     ` Eric Paris
2011-04-12 13:31 ` v2 Add class support to the " Steve Lawrence

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=1301071836.22099.22.camel@moss-pluto \
    --to=sds@tycho.nsa.gov \
    --cc=eparis@parisplace.org \
    --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.