All of lore.kernel.org
 help / color / mirror / Atom feed
* secilc: in statement ordering limitations
@ 2014-05-21 16:30 Dominick Grift
  2014-05-21 18:41 ` James Carter
  2014-05-23 13:15 ` James Carter
  0 siblings, 2 replies; 7+ messages in thread
From: Dominick Grift @ 2014-05-21 16:30 UTC (permalink / raw)
  To: selinux

I got a little carried away with block and in statements (to say the
least)

I hit a limitation were ordering of modules matters (e.g. ordering of
entries in LISTING or entries fed into secilc)

I order my modules in alphabetical order so for example
policy/modules/systemd/systemd.cil comes after
policy/modules/system/dbus for example.

If i, in the dbus.cil file now want to insert some declarations in a
systemd block i hit issues due to that ordering issue

If i move the systemd.cil up the stack then i can work around the
ordering issue but it is a dead-end. Ordering issues suck (/me points to
sidorder statement)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: secilc: in statement ordering limitations
  2014-05-21 16:30 secilc: in statement ordering limitations Dominick Grift
@ 2014-05-21 18:41 ` James Carter
  2014-05-23 13:15 ` James Carter
  1 sibling, 0 replies; 7+ messages in thread
From: James Carter @ 2014-05-21 18:41 UTC (permalink / raw)
  To: Dominick Grift, selinux

On 05/21/2014 12:30 PM, Dominick Grift wrote:
> I got a little carried away with block and in statements (to say the
> least)
>
> I hit a limitation were ordering of modules matters (e.g. ordering of
> entries in LISTING or entries fed into secilc)
>
> I order my modules in alphabetical order so for example
> policy/modules/systemd/systemd.cil comes after
> policy/modules/system/dbus for example.
>
> If i, in the dbus.cil file now want to insert some declarations in a
> systemd block i hit issues due to that ordering issue
>
> If i move the systemd.cil up the stack then i can work around the
> ordering issue but it is a dead-end. Ordering issues suck (/me points to
> sidorder statement)
>
>

Thanks for the report. All ordering issues are bugs.

-- 
James Carter <jwcart2@tycho.nsa.gov>
National Security Agency

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: secilc: in statement ordering limitations
  2014-05-21 16:30 secilc: in statement ordering limitations Dominick Grift
  2014-05-21 18:41 ` James Carter
@ 2014-05-23 13:15 ` James Carter
  2014-05-23 14:32   ` Dominick Grift
  1 sibling, 1 reply; 7+ messages in thread
From: James Carter @ 2014-05-23 13:15 UTC (permalink / raw)
  To: Dominick Grift, selinux

On 05/21/2014 12:30 PM, Dominick Grift wrote:
> I got a little carried away with block and in statements (to say the
> least)
>
> I hit a limitation were ordering of modules matters (e.g. ordering of
> entries in LISTING or entries fed into secilc)
>
> I order my modules in alphabetical order so for example
> policy/modules/systemd/systemd.cil comes after
> policy/modules/system/dbus for example.
>
> If i, in the dbus.cil file now want to insert some declarations in a
> systemd block i hit issues due to that ordering issue
>

I am having problems reproducing the problem.

In one file, I have:

(block bb
	(type t1)
	(type t2)
	(boolean b1 false)
	(tunable tun1 true)
	(macro m ((boolean b))
		(tunableif tun1
			(true
				(allow t1 t2 (policy.file (write))))
			(false
				(allow t1 t2 (policy.file (execute)))))
		(booleanif b
			(true
				(allow t1 t2 (policy.file (read))))))

	(call m (b1))
)

and in another, I have:

(in bb
	(tunableif bb.tun1
		(true
			(allow t2 t1 (policy.file (read write execute)))))
	(type t3))

The order that I send the files to secilc doesn't seem to matter.

Could you give me a little bit more information on what you are doing?

Thanks,
Jim

> If i move the systemd.cil up the stack then i can work around the
> ordering issue but it is a dead-end. Ordering issues suck (/me points to
> sidorder statement)
>
>
>
> _______________________________________________
> Selinux mailing list
> Selinux@tycho.nsa.gov
> To unsubscribe, send email to Selinux-leave@tycho.nsa.gov.
> To get help, send an email containing "help" to Selinux-request@tycho.nsa.gov.
>
>


-- 
James Carter <jwcart2@tycho.nsa.gov>
National Security Agency

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: secilc: in statement ordering limitations
  2014-05-23 13:15 ` James Carter
@ 2014-05-23 14:32   ` Dominick Grift
  2014-05-23 15:02     ` Dominick Grift
  2014-05-23 15:04     ` Steve Lawrence
  0 siblings, 2 replies; 7+ messages in thread
From: Dominick Grift @ 2014-05-23 14:32 UTC (permalink / raw)
  To: James Carter; +Cc: selinux

On Fri, 2014-05-23 at 09:15 -0400, James Carter wrote:

> Could you give me a little bit more information on what you are doing?

Strange.. It is kind of hard for me to put it any other way.

I have a short 5 minute video that demo's the issue:

https://www.youtube.com/watch?v=hU_yVZJpAyM

If you are not able to view the demo then i guess i will have to find
another way to explain it

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: secilc: in statement ordering limitations
  2014-05-23 14:32   ` Dominick Grift
@ 2014-05-23 15:02     ` Dominick Grift
  2014-05-23 15:04     ` Steve Lawrence
  1 sibling, 0 replies; 7+ messages in thread
From: Dominick Grift @ 2014-05-23 15:02 UTC (permalink / raw)
  To: James Carter; +Cc: selinux

On Fri, 2014-05-23 at 16:32 +0200, Dominick Grift wrote:
> On Fri, 2014-05-23 at 09:15 -0400, James Carter wrote:
> 
> > Could you give me a little bit more information on what you are doing?
> 
> Strange.. It is kind of hard for me to put it any other way.

The core, i suspect, is that in my case systemd depends on a namespace
in dbus ( file.etc.dbusd.systemd.obj ) and dbus depends on a namespace
in systemd (file.unit.systemd.dbusd.obj)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: secilc: in statement ordering limitations
  2014-05-23 14:32   ` Dominick Grift
  2014-05-23 15:02     ` Dominick Grift
@ 2014-05-23 15:04     ` Steve Lawrence
  2014-05-27 16:47       ` James Carter
  1 sibling, 1 reply; 7+ messages in thread
From: Steve Lawrence @ 2014-05-23 15:04 UTC (permalink / raw)
  To: Dominick Grift, James Carter; +Cc: selinux

On 05/23/2014 10:32 AM, Dominick Grift wrote:
> On Fri, 2014-05-23 at 09:15 -0400, James Carter wrote:
> 
>> Could you give me a little bit more information on what you are doing?
> 
> Strange.. It is kind of hard for me to put it any other way.
> 
> I have a short 5 minute video that demo's the issue:
> 
> https://www.youtube.com/watch?v=hU_yVZJpAyM
> 
> If you are not able to view the demo then i guess i will have to find
> another way to explain it
> 

I think this is an example of the core problem:

  (in foo.bar
    (type x))

  (in foo
    (block bar))

  (block foo)

So, an in-statement is inserting into a block that is created by another
in-statement, so there's an order dependence.

- Steve

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: secilc: in statement ordering limitations
  2014-05-23 15:04     ` Steve Lawrence
@ 2014-05-27 16:47       ` James Carter
  0 siblings, 0 replies; 7+ messages in thread
From: James Carter @ 2014-05-27 16:47 UTC (permalink / raw)
  To: Steve Lawrence, Dominick Grift; +Cc: selinux

On 05/23/2014 11:04 AM, Steve Lawrence wrote:
> On 05/23/2014 10:32 AM, Dominick Grift wrote:
>> On Fri, 2014-05-23 at 09:15 -0400, James Carter wrote:
>>
>>> Could you give me a little bit more information on what you are doing?
>>
>> Strange.. It is kind of hard for me to put it any other way.
>>
>> I have a short 5 minute video that demo's the issue:
>>
>> https://www.youtube.com/watch?v=hU_yVZJpAyM
>>
>> If you are not able to view the demo then i guess i will have to find
>> another way to explain it
>>
>
> I think this is an example of the core problem:
>
>    (in foo.bar
>      (type x))
>
>    (in foo
>      (block bar))
>
>    (block foo)
>
> So, an in-statement is inserting into a block that is created by another
> in-statement, so there's an order dependence.
>

So to fix this we need to split up the processing for "in", so that blocks and 
macros are processed first?

Jim

-- 
James Carter <jwcart2@tycho.nsa.gov>
National Security Agency

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-05-27 16:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-21 16:30 secilc: in statement ordering limitations Dominick Grift
2014-05-21 18:41 ` James Carter
2014-05-23 13:15 ` James Carter
2014-05-23 14:32   ` Dominick Grift
2014-05-23 15:02     ` Dominick Grift
2014-05-23 15:04     ` Steve Lawrence
2014-05-27 16:47       ` James Carter

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.