selinux: stop passing selinux_state pointers and their offspring
authorStephen Smalley <stephen.smalley.work@gmail.com>
Thu, 9 Mar 2023 18:30:37 +0000 (13:30 -0500)
committerPaul Moore <paul@paul-moore.com>
Tue, 14 Mar 2023 19:22:45 +0000 (15:22 -0400)
commite67b79850fcc4eb5816d69d34fd82aeda350aca7
treeac2ab206d913dd36a95347b59bc739551651cafc
parentf62ca0b6e31d82e0622a8e31ce5562e80edf6c3c
selinux: stop passing selinux_state pointers and their offspring

Linus observed that the pervasive passing of selinux_state pointers
introduced by me in commit aa8e712cee93 ("selinux: wrap global selinux
state") adds overhead and complexity without providing any
benefit. The original idea was to pave the way for SELinux namespaces
but those have not yet been implemented and there isn't currently
a concrete plan to do so. Remove the passing of the selinux_state
pointers, reverting to direct use of the single global selinux_state,
and likewise remove passing of child pointers like the selinux_avc.
The selinux_policy pointer remains as it is needed for atomic switching
of policies.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/oe-kbuild-all/202303101057.mZ3Gv5fK-lkp@intel.com/
Signed-off-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
18 files changed:
security/selinux/avc.c
security/selinux/hooks.c
security/selinux/ibpkey.c
security/selinux/ima.c
security/selinux/include/avc.h
security/selinux/include/avc_ss.h
security/selinux/include/conditional.h
security/selinux/include/ima.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/services.c
security/selinux/ss/services.h
security/selinux/status.c
security/selinux/xfrm.c