selinux: wrap global selinux state
authorStephen Smalley <sds@tycho.nsa.gov>
Thu, 1 Mar 2018 23:48:02 +0000 (18:48 -0500)
committerPaul Moore <paul@paul-moore.com>
Thu, 1 Mar 2018 23:48:02 +0000 (18:48 -0500)
commitaa8e712cee93d520e96a2ca8e3a20f807c937e3f
tree5e2bdce92022ebb334bfa68b6a731b71ef86974d
parent2572f5b4245abf2b4e5a86cabf65a50efda09aac
selinux: wrap global selinux state

Define a selinux state structure (struct selinux_state) for
global SELinux state and pass it explicitly to all security server
functions.  The public portion of the structure contains state
that is used throughout the SELinux code, such as the enforcing mode.
The structure also contains a pointer to a selinux_ss structure whose
definition is private to the security server and contains security
server specific state such as the policy database and SID table.

This change should have no effect on SELinux behavior or APIs
(userspace or LSM).  It merely wraps SELinux state and passes it
explicitly as needed.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
[PM: minor fixups needed due to collisions with the SCTP patches]
Signed-off-by: Paul Moore <paul@paul-moore.com>
25 files changed:
security/selinux/avc.c
security/selinux/hooks.c
security/selinux/ibpkey.c
security/selinux/include/avc.h
security/selinux/include/avc_ss.h
security/selinux/include/conditional.h
security/selinux/include/objsec.h
security/selinux/include/security.h
security/selinux/netif.c
security/selinux/netlabel.c
security/selinux/netnode.c
security/selinux/netport.c
security/selinux/selinuxfs.c
security/selinux/ss/avtab.c
security/selinux/ss/avtab.h
security/selinux/ss/ebitmap.c
security/selinux/ss/ebitmap.h
security/selinux/ss/hashtab.c
security/selinux/ss/hashtab.h
security/selinux/ss/mls.c
security/selinux/ss/mls.h
security/selinux/ss/services.c
security/selinux/ss/services.h
security/selinux/ss/status.c
security/selinux/xfrm.c