Skip to contentSkip to conversation

Building MLS/MCS policy

refpolicy Guido Trentalancia 2 participants 2 messages Jan 26, 2010

lore
Share & tools
lore
#0 lore raw

Stephen,

Quoted 5 lines

If libsemanage encounters an error at any point during the update transaction, it rolls back to the previous policy as a safety measure so that your system will still have a known working policy in place. So when it failed to load the MCS policy into the kernel, it performed the rollback.

Yes, the first point definitely makes sense.

Quoted 5 lines

Using a different store name disables automatic loading of the policy since it isn't your active policy store (as defined by your /etc/selinux/config), and thus avoids the problem. The other solution would have been to pass -n to semodule to disable automatic loading of the new policy.

This second point is a bit more difficult to understand at first. Especially because, when I was not changing the name, the new MCS policy didn't even load after rebooting (i.e. doing "make install", "make load", the latter fails so reboot and then eventually try doing again "make load" after reboot which fails again). In particular, I still don't understand why after rebooting it failed to load the new policy even though "make install" succeeded...

Anyway, what do you think about the two notes in the documentation ?

Regards,

Guido

#1 lore raw
Quoted 16 lines · Guido Trentalancia

Stephen,

Quoted 5 lines

If libsemanage encounters an error at any point during the update transaction, it rolls back to the previous policy as a safety measure so that your system will still have a known working policy in place. So when it failed to load the MCS policy into the kernel, it performed the rollback.

Yes, the first point definitely makes sense.

Quoted 5 lines

Using a different store name disables automatic loading of the policy since it isn't your active policy store (as defined by your /etc/selinux/config), and thus avoids the problem. The other solution would have been to pass -n to semodule to disable automatic loading of the new policy.

Quoted 7 lines

This second point is a bit more difficult to understand at first. Especially because, when I was not changing the name, the new MCS policy didn't even load after rebooting (i.e. doing "make install", "make load", the latter fails so reboot and then eventually try doing again "make load" after reboot which fails again). In particular, I still don't understand why after rebooting it failed to load the new policy even though "make install" succeeded...

refpolicy make install just installs the modules
under /usr/share/selinux. refpolicy make load runs semodule to insert the modules into the active policy store, and that fails on the reload attempt and thus reverts to the previous policy. Running semodule with the -n option would avoid attempting to load the policy and thus would have yielded the behavior you wanted.

Quoted 1 line

Anyway, what do you think about the two notes in the documentation ?

Signature · 2 lines
Stephen Smalley
National Security Agency