selinux: clean up selinux_enabled/disabled/enforcing_boot
Rename selinux_enabled to selinux_enabled_boot to make it clear that it only reflects whether SELinux was enabled at boot. Replace the references to it in the MAC_STATUS audit log in sel_write_enforce() with hardcoded "1" values because this code is only reachable if SELinux is enabled and does not change its value, and update the corresponding MAC_STATUS audit log in sel_write_disable(). Stop clearing selinux_enabled in selinux_disable() since it is not used outside of initialization code that runs before selinux_disable() can be reached. Mark both selinux_enabled_boot and selinux_enforcing_boot as __initdata since they are only used in initialization code. Wrap the disabled field in the struct selinux_state with CONFIG_SECURITY_SELINUX_DISABLE since it is only used for runtime disable. Signed-off-by:Stephen Smalley <sds@tycho.nsa.gov> Signed-off-by:
Paul Moore <paul@paul-moore.com>
Showing
- security/selinux/hooks.c 5 additions, 7 deletionssecurity/selinux/hooks.c
- security/selinux/ibpkey.c 1 addition, 1 deletionsecurity/selinux/ibpkey.c
- security/selinux/include/security.h 3 additions, 1 deletionsecurity/selinux/include/security.h
- security/selinux/netif.c 1 addition, 1 deletionsecurity/selinux/netif.c
- security/selinux/netnode.c 1 addition, 1 deletionsecurity/selinux/netnode.c
- security/selinux/netport.c 1 addition, 1 deletionsecurity/selinux/netport.c
- security/selinux/selinuxfs.c 5 additions, 6 deletionssecurity/selinux/selinuxfs.c
Loading
Please register or sign in to comment