Skip to contentSkip to conversation

secilc: in statement ordering limitations

DISCUSSION Dominick Grift 3 participants 7 messages May 21, 2014 – May 27, 2014 SELinux security module

lore
Share & tools
lore
#0 lore raw

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)

#1 lore raw
Quoted 10 lines · Dominick Grift

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.

Quoted 8 lines

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.

Signature · 2 lines
James Carter <[email protected]>
National Security Agency
#2 lore raw
In reply to Dominick Grift
Quoted 6 lines · Dominick Grift

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)

Quoted 7 lines

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

Quoted 13 lines

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
[email protected]
To unsubscribe, send email to [email protected].
To get help, send an email containing "help" to [email protected].

Signature · 2 lines
James Carter <[email protected]>
National Security Agency
#3 lore raw
Quoted 1 line · James Carter

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

#4 lore raw
Quoted 5 lines · Dominick Grift
Quoted 1 line · James Carter

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)

#5 lore raw
In reply to Dominick Grift
Quoted 4 lines · Dominick Grift
Quoted 1 line · James Carter

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

Quoted 9 lines

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

#6 lore raw
Quoted 25 lines · Steve Lawrence
Quoted 4 lines · Dominick Grift
Quoted 1 line · James Carter

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

Quoted 9 lines

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)
Quoted 3 lines

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

Signature · 2 lines
James Carter <[email protected]>
National Security Agency