All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harry Ciao <qingtao.cao@windriver.com>
To: "Christopher J. PeBenito" <cpebenito@tresys.com>
Cc: <selinux@tycho.nsa.gov>
Subject: Re: [PATCH 1/1] role_fix_callback skips out-of-scope roles during expansion.
Date: Sat, 25 Feb 2012 09:34:34 +0800	[thread overview]
Message-ID: <4F483AAA.4070708@windriver.com> (raw)
In-Reply-To: <4F479C0A.6070102@tresys.com>



On 02/24/2012 10:17 PM, Christopher J. PeBenito wrote:
> On 02/24/12 02:12, Harry Ciao wrote:
>> If a role identifier is out of scope it would be skipped over during
>> expansion, accordingly, be it a role attribute, it should be skipped
>> over as well when role_fix_callback tries to propagate its capability
>> to all its sub-roles.
>>
>> BTW, it's worthwhile to note that the symtab and rules of an optional
>> block in a loadable module will be written to its pp. However, for the
>> base module the entire optional block will be omitted if its exterior
>> dependency cannot be properly satisfied.
> This doesn't sound correct.  If optionals don't exist in the base module, then that would be a significant problem for current policy.

Ok, even the second part of this patch header doesn't sound correct, the 
patch itself is a must-have so that during expansion role_fix_callback 
will skip the same out-of-scope roles as skipped by role_copy_callback. 
Otherwise the logic won't be consistent.

I will send a v1 patch without the second part of header, it's not 
directly related with the patch anyway.

However, from my testing with the simple x.te came up by Martin Orr in 
another recent thread, if an optional block contains an out-of-scope 
symbol, then that symbol won't be expanded from the base module to the 
out module during expansion, that's why the current assertion in 
role_fix_callback is failed and made me come up this patch to make 
role_fix_callback skip those out-of-scope roles as well.

 From the source code, is_id_enabled will be called by various 
xxx_copy_callback during expansion, which returns 0 if it fails to find 
at least one scope_datum_t with the type of SCOPE_DECL for the current 
symbol, which is right the out-of-scope symbol that has just been 
required but not declared yet.

Did I miss anything?

Thanks,
Harry




--
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:[~2012-02-25  1:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-24  7:12 [PATCH 1/1] role_fix_callback skips out-of-scope roles during expansion Harry Ciao
2012-02-24 14:17 ` Christopher J. PeBenito
2012-02-25  1:34   ` Harry Ciao [this message]

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=4F483AAA.4070708@windriver.com \
    --to=qingtao.cao@windriver.com \
    --cc=cpebenito@tresys.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.