All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Carter <jwcart2@tycho.nsa.gov>
To: James Carter <jwcart2@tycho.nsa.gov>
Cc: Dominick Grift <dominick.grift@gmail.com>,
	SELinux List <selinux@tycho.nsa.gov>,
	Steve Lawrence <slawrence@tresys.com>,
	Richard Haines <richard_c_haines@btinternet.com>
Subject: Re: Update to CIL
Date: Wed, 23 Oct 2013 13:00:56 -0400	[thread overview]
Message-ID: <526800C8.5050306@tycho.nsa.gov> (raw)
In-Reply-To: <5267F222.5010606@tycho.nsa.gov>

On 10/23/2013 11:58 AM, James Carter wrote:
> On 10/23/2013 11:15 AM, Dominick Grift wrote:
>> On Fri, 2013-10-18 at 14:20 -0400, James Carter wrote:
>>> I pushed an update of CIL to bitbucket.
>>
>> I noticed that cilpolicy does not have refpolicies
>> "selinux_labeled_boolean" interface
>>
>
> This interface causes many problems.
>
> First, when trying to convert Refpolicy to CIL, the conversion program tries to
> infer parameter types (language types, not SELinux types). This interface causes
> an error because the parameter which is the boolean name is used as both a
> string and a boolean.
>
> Second, the conversion program can't recognize general string concatenation
> (although it does specifically handle type mangling).
>
> Third, CIL does not allow conversion from one language type to another.
>
> Fourth, CIL does not have the ability to concatenate strings.
>
> All of these problems could probably be worked around, but I would prefer not to
> have general string concatenation and language type conversions in CIL.
>
> This is a perfect example of something that a higher-level language could
> provide. Although that doesn't help you now.
>
>> I tried to implement it myself but i cannot get it to parse ARG2 no
>> matter what i try
>>
>> This is what i currently have:
>>
>> macro:
>>
>>> ; Associate the specified type and name with booleans
>>>
>>> (macro selinux_labeled_boolean ((type ARG1) (name ARG2))
>>>    (call selinux_boolean_type (ARG1))
>>>    (genfscon "selinuxfs" ARG2 (system_u object_r ARG1 ((s0)
>>>              (s0)))))
>>
>> call:
>>
>>> (type secure_mode_insmod_t)
>>> (call selinux_labeled_boolean (secure_mode_insmod_t
>>>               "/booleans/secure_mode_insmod"))
>>
>> result:
>>
>>> # seinfo --genfscon | grep secure_mode_insmod
>>>     genfscon selinuxfs ARG2      system_u:object_r:secure_mode_insmod_t
>>
>> Is there a work around for this?
>>
>
> Sorry, there is not.
>
>> I realize that the nature of cil make these kind of things less useful
>> but it would have been nice if it worked
>>

I am sorry. I got so caught up in the painful memories of having to deal with 
the selinux_labeled_boolean interface that I missed what you were actually 
trying to do.

What you want to do here is quite reasonable and we should make it possible in CIL.

Thanks again for the feedback.

-- 
James Carter <jwcart2@tycho.nsa.gov>
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:[~2013-10-23 17:00 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-18 18:20 Update to CIL James Carter
2013-10-18 20:02 ` Dominick Grift
2013-10-19 13:32   ` Dominick Grift
2013-10-19 18:03     ` Dominick Grift
2013-10-20 14:25       ` Dominick Grift
2013-10-21 13:25     ` Steve Lawrence
2013-10-21 18:56       ` James Carter
2013-10-21 12:35   ` Steve Lawrence
2013-10-19 16:23 ` Richard Haines
2013-10-21 13:36   ` Steve Lawrence
2013-10-21 14:22     ` Richard Haines
2013-10-21 14:46       ` Steve Lawrence
2013-10-21 15:49     ` Request for a new CIL statement Richard Haines
2013-10-21 19:14   ` Update to CIL James Carter
2013-10-23 13:59 ` Dominick Grift
2013-10-23 14:29   ` James Carter
2013-10-23 15:15 ` Dominick Grift
2013-10-23 15:58   ` James Carter
2013-10-23 17:00     ` James Carter [this message]
2013-10-23 17:27       ` Dominick Grift
2013-10-24 20:16 ` Dominick Grift
2013-10-25 17:53 ` Dominick Grift
2013-10-25 18:40   ` James Carter
2013-10-25 18:55     ` Dominick Grift
2013-10-25 18:40 ` Dominick Grift
2013-10-26 11:58 ` Dominick Grift
2013-10-31  9:45 ` Dominick Grift

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=526800C8.5050306@tycho.nsa.gov \
    --to=jwcart2@tycho.nsa.gov \
    --cc=dominick.grift@gmail.com \
    --cc=richard_c_haines@btinternet.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.