From: Joshua Brindle <method@manicmethod.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Joe Nall <joe@nall.com>, Eamon Walsh <ewalsh@tycho.nsa.gov>,
Daniel J Walsh <dwalsh@redhat.com>,
"Christopher J. PeBenito" <cpebenito@tresys.com>,
SE Linux <selinux@tycho.nsa.gov>
Subject: Re: Use of optional_policy in templates (compiler bug or feature?)
Date: Thu, 23 Oct 2008 10:15:48 -0400 [thread overview]
Message-ID: <49008714.1020306@manicmethod.com> (raw)
In-Reply-To: <1224771040.28867.33.camel@moss-spartans.epoch.ncsc.mil>
Stephen Smalley wrote:
> On Wed, 2008-10-22 at 13:42 -0400, Joshua Brindle wrote:
>
>> Stephen Smalley wrote:
>>
>>> On Wed, 2008-10-22 at 10:28 -0400, Stephen Smalley wrote:
>>>
>>>
>>>> On Wed, 2008-10-22 at 09:26 -0500, Joe Nall wrote:
>>>>
>>>>
>>>>> On Oct 22, 2008, at 9:01 AM, Stephen Smalley wrote:
>>>>>
>>>>>
>>>>>
>>>>>> I did notice however that I could also get it to build w/o
>>>>>> changing checkmodule by reversing the order of the interface calls
>>>>>> there
>>>>>> - not sure if that workaround is usable in the original case that
>>>>>> triggered this bug report.
>>>>>>
>>>>>>
>>>>> Arranging modules in the proper order becomes increasingly difficult
>>>>> as module interaction grows. I finally de-optioned the X policy in
>>>>> fedora since it is in base so get our additions to compile. Patch
>>>>> included for reference.
>>>>>
>>>>> Making the compiler gracefully deal with options would really be
>>>>> appreciated. I could see the issue in the compiler code, but the right
>>>>> fix wasn't obvious.
>>>>>
>>>>>
>>>> Does the patch I posted fix your problem?
>>>>
>>>>
>>> And by fix, I mean not only does it allow you to build the policy but
>>> does it yield the expected final kernel policy (i.e. look at the
>>> policy.N file via apol and check that you are getting the expected types
>>> and rules in the final policy).
>>>
>>>
>> I just worry that allowing situations like this will cause the linker to
>> not properly (or deterministically) enable optional blocks. That is why
>> we require everything be scoped locally to be used. We have, however,
>> made changes to the linker algorithm since the original module codebase
>> so it might have gotten better, but I don't think anyone has sat down
>> and figured out exactly which cases can be required and which ones may
>> be prevented.
>>
>
> The particular case is:
> optional {
> require {
> type system_dbusd_t, system_dbusd_t, dbusd_etc_t;
> class dbus { send_msg acquire_svc };
> attribute dbusd_unconfined;
> }
> type swo_dbusd_t;
> ...
> }
>
> require {
> type swo_t;
> type swo_dbusd_t;
> class dbus send_msg;
> }
> ...
>
> So the require that is triggering a misleading "duplicate
> type/attribute" error under the current toolchain is not within an
> optional block at all. And if you switch the order, it compiles fine
> (because we already allow decl-follows-require). It shouldn't be order
> dependent obviously.
>
> In any event, the compiler breakage is preventing people from doing real
> work, and doesn't seem to be a bug in policy. It needs to be fixed.
>
>
Ok, waiting on Joe to respond with whether your last patch fixed his
problems then I'll apply it here and see if it blows anything up.
--
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-10-23 14:15 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-15 16:02 Use of optional_policy in templates (compiler bug or feature?) Joe Nall
2008-10-15 18:46 ` Christopher J. PeBenito
2008-10-15 19:59 ` Joe Nall
2008-10-16 12:49 ` Christopher J. PeBenito
2008-10-16 13:43 ` Joe Nall
2008-10-16 14:50 ` Joshua Brindle
2008-10-16 15:46 ` Joe Nall
2008-10-20 18:19 ` Daniel J Walsh
2008-10-20 18:41 ` Joe Nall
2008-10-20 23:52 ` Eamon Walsh
2008-10-22 14:01 ` Stephen Smalley
2008-10-22 14:26 ` Joe Nall
2008-10-22 14:28 ` Stephen Smalley
2008-10-22 14:32 ` Stephen Smalley
2008-10-22 17:42 ` Joshua Brindle
2008-10-23 14:10 ` Stephen Smalley
2008-10-23 14:15 ` Joshua Brindle [this message]
2008-10-23 14:16 ` Stephen Smalley
2008-11-24 3:35 ` Joe Nall
2008-12-02 14:26 ` Joe Nall
2008-12-02 14:27 ` Stephen Smalley
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=49008714.1020306@manicmethod.com \
--to=method@manicmethod.com \
--cc=cpebenito@tresys.com \
--cc=dwalsh@redhat.com \
--cc=ewalsh@tycho.nsa.gov \
--cc=joe@nall.com \
--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.