Skip to contentSkip to conversation

Booleans and tunable_policy

DISCUSSION Salvo Giuffrida 2 participants 2 messages Oct 22, 2006 – Oct 23, 2006 SELinux security module

lore
Share & tools
lore
#0 lore raw

I saw that in the reference policy there aren't anymore if-else constructs for the conditional evaluation of rules; instead, the tunable_policy macro is used (which I don't understand where it is declared)...What's wrong with the old "if-else" method? And, why should the booleans be first declared in global_booleans? Thanks

_________________________________________________________________
Usa il tuo PC come un telefono per chiamare cellulari e telefoni fissi! http://imagine-msn.com/messenger/launch80/?locale=it-it&TAB=2

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#1 lore raw
Quoted 4 lines · Salvo Guffrida

I saw that in the reference policy there aren't anymore if-else constructs for the conditional evaluation of rules; instead, the tunable_policy macro is used (which I don't understand where it is declared)...What's wrong with the old "if-else" method?

Tunable_policy are blocks that will be replaced by a similar language feature when it becomes available. Tunables will be similar to conditionals, except they will be selected during the policy module linking instead of being selectable at runtime. This will result in a smaller policy, since there won't be dead policy from disabled booleans (a disabled tunable block will not be in the final policy). Almost all of the booleans are configuration options, which means they would be better served as tunables. For example, you wouldn't be toggling use_nfs_home_dirs many times on a running system, you would set it once and be done with it. The tunable_policy macro will also be used to switch the blocks back to conditional policy if needed (it is always conditional policy currently). The macro is declared on line 159 of loadable_module.spt.

The "if-else" conditional policy blocks are still used where it makes sense that the policy is runtime configurable. See line 153 of selinux.if for an example.

Quoted 1 line

And, why should the booleans be first declared in global_booleans?

Originally when we made refpolicy, we did not know how to export a boolean by an interface that made sense, so we made all booleans and tunables global until we had a solution. We have began to move tunables back to modules if they are only used in that module, for example, named_write_master_zones.

Signature · 9 lines
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.