Skip to contentSkip to conversation

selinux: stop passing selinux_state pointers and their offspring

PATCH Paul Moore 1 participant 1 message Mar 14, 2023 1 message not in the archive SELinux security module

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Paul Moore

author maintainer Applied
#1 lore raw
Quoted 30 lines · Stephen Smalley

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.

---
v2 fixes the lockdep_assert_held() in security/selinux/ima.c reported by kernel test robot.

 security/selinux/avc.c                 | 197 ++++-----
 security/selinux/hooks.c               | 549 ++++++++++---------------
 security/selinux/ibpkey.c              |   2 +-
 security/selinux/ima.c                 |  37 +-
 security/selinux/include/avc.h         |  29 +-
 security/selinux/include/avc_ss.h      |   3 +-
 security/selinux/include/conditional.h |   4 +-
 security/selinux/include/ima.h         |  10 +-
 security/selinux/include/security.h    | 171 +++-----
 security/selinux/netif.c               |   2 +-
 security/selinux/netlabel.c            |  17 +-
Quoted 8 lines
 security/selinux/netnode.c             |   4 +-
 security/selinux/netport.c             |   2 +-
 security/selinux/selinuxfs.c           | 208 ++++------
 security/selinux/ss/services.c         | 346 +++++++---------
 security/selinux/ss/services.h         |   1 -
 security/selinux/status.c              |  44 +-
 security/selinux/xfrm.c                |  20 +-
 18 files changed, 651 insertions(+), 995 deletions(-)

Merged into selinux/next, thanks Stephen.

Signature · 1 line
paul-moore.com