mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
selinux: stop passing selinux_state pointers and their offspring
Linus observed that the pervasive passing of selinux_state pointers
introduced by me in commit aa8e712cee ("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>
This commit is contained in:
committed by
Paul Moore
parent
f62ca0b6e3
commit
e67b79850f
@@ -204,13 +204,13 @@ static int sel_netnode_sid_slow(void *addr, u16 family, u32 *sid)
|
||||
new = kzalloc(sizeof(*new), GFP_ATOMIC);
|
||||
switch (family) {
|
||||
case PF_INET:
|
||||
ret = security_node_sid(&selinux_state, PF_INET,
|
||||
ret = security_node_sid(PF_INET,
|
||||
addr, sizeof(struct in_addr), sid);
|
||||
if (new)
|
||||
new->nsec.addr.ipv4 = *(__be32 *)addr;
|
||||
break;
|
||||
case PF_INET6:
|
||||
ret = security_node_sid(&selinux_state, PF_INET6,
|
||||
ret = security_node_sid(PF_INET6,
|
||||
addr, sizeof(struct in6_addr), sid);
|
||||
if (new)
|
||||
new->nsec.addr.ipv6 = *(struct in6_addr *)addr;
|
||||
|
||||
Reference in New Issue
Block a user