All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Brindle <method@manicmethod.com>
To: qingtao.cao@windriver.com
Cc: Steve Lawrence <slawrence@tresys.com>,
	cpebenito@tresys.com, selinux@tycho.nsa.gov
Subject: Re: [v0 PATCH 1/1] Only call role_fix_callback for base.p_roles during expansion.
Date: Thu, 11 Aug 2011 22:47:22 -0400	[thread overview]
Message-ID: <4E44943A.5060407@manicmethod.com> (raw)
In-Reply-To: <4E449158.1000408@windriver.com>

Harry Ciao wrote:
> Hi Steve,
>
> Steve Lawrence 写道:
>> However, I did find what appears to be an unrelated problem. It looks
>> like the role attributes are getting written to the policy db as if they
>> were roles. I don't think this will break anything (I think), but
>> considering that the kernel doesn't know anything about role_attributes,
>> it seems odd to me that they are in the binary.
>>
>> Note: I found this by looking at a downgraded policy.24 in apol, so this
>> could potentially be a downgrade issue. But from looking at the code, I
>> believe role attributes are being written as if they're roles.
>>
>> - Steve
>>
>>
>>
> You are right!
>
> The role attribute's destination would have been fulfilled at the expand
> stage when its types.types ebitmap populated to all its sub regular
> roles, thus there is no need to write role attribute's role_datum_t to
> policy.X at all. This won't cause any harm, but redundant.
>
> We could bail out from role_write() when finding out the current datum
> is a role attribute while writing to policy.X. I would send out a patch
> later today.
>
> BTW, I'd also noticed role attribute by apol but I didn't realize what
> you have realized, so it's always beneficial to have others review your
> patches :-)
>

When downgrading a policy I believe the downgraded policy should be 
identical (e.g., binary diffable or very close if not possible) to the 
older toolchain. In this case I don't see a reason why the downgraded 
policy should have the role_attributes in the role symtab. There should 
be a patch to correctly discard them when downgrading IMO.

--
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-08-12  2:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-02 10:03 v0 Only call role_fix_callback for base.p_roles during expansion Harry Ciao
2011-08-02 10:03 ` [v0 PATCH 1/1] " Harry Ciao
2011-08-11 14:05   ` Steve Lawrence
2011-08-11 20:30     ` Eric Paris
2011-08-12  2:35     ` Harry Ciao
2011-08-12  2:47       ` Joshua Brindle [this message]
2011-08-12  2:54         ` 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=4E44943A.5060407@manicmethod.com \
    --to=method@manicmethod.com \
    --cc=cpebenito@tresys.com \
    --cc=qingtao.cao@windriver.com \
    --cc=selinux@tycho.nsa.gov \
    --cc=slawrence@tresys.com \
    /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.