selinux_state
struct selinux_state selinux_state;
memset(&selinux_state, 0, sizeof(selinux_state));
mutex_init(&selinux_state.status_lock);
mutex_init(&selinux_state.policy_mutex);
lockdep_assert_not_held(&selinux_state.policy_mutex);
mutex_lock(&selinux_state.policy_mutex);
mutex_unlock(&selinux_state.policy_mutex);
rc = strlcat(buf, selinux_state.policycap[i] ? on : off,
lockdep_assert_held(&selinux_state.policy_mutex);
extern struct selinux_state selinux_state;
return smp_load_acquire(&selinux_state.initialized);
smp_store_release(&selinux_state.initialized, true);
return READ_ONCE(selinux_state.enforcing);
WRITE_ONCE(selinux_state.enforcing, value);
return READ_ONCE(selinux_state.policycap[POLICYDB_CAP_NETPEER]);
return READ_ONCE(selinux_state.policycap[POLICYDB_CAP_OPENPERM]);
return READ_ONCE(selinux_state.policycap[POLICYDB_CAP_EXTSOCKCLASS]);
return READ_ONCE(selinux_state.policycap[POLICYDB_CAP_ALWAYSNETWORK]);
return READ_ONCE(selinux_state.policycap[POLICYDB_CAP_CGROUPSECLABEL]);
selinux_state.policycap[POLICYDB_CAP_NNP_NOSUID_TRANSITION]);
selinux_state.policycap[POLICYDB_CAP_GENFS_SECLABEL_SYMLINKS]);
selinux_state.policycap[POLICYDB_CAP_IOCTL_SKIP_CLOEXEC]);
selinux_state.policycap[POLICYDB_CAP_USERSPACE_INITIAL_CONTEXT]);
selinux_state.policycap[POLICYDB_CAP_NETLINK_XPERM]);
selinux_state.policycap[POLICYDB_CAP_FUNCTIONFS_SECLABEL]);
return READ_ONCE(selinux_state.policycap[POLICYDB_CAP_MEMFD_CLASS]);
selinux_state.policycap[POLICYDB_CAP_BPF_TOKEN_PERMS]);
mutex_lock(&selinux_state.policy_mutex);
mutex_unlock(&selinux_state.policy_mutex);
mutex_unlock(&selinux_state.policy_mutex);
mutex_lock(&selinux_state.policy_mutex);
mutex_unlock(&selinux_state.policy_mutex);
mutex_lock(&selinux_state.policy_mutex);
mutex_unlock(&selinux_state.policy_mutex);
mutex_lock(&selinux_state.policy_mutex);
mutex_unlock(&selinux_state.policy_mutex);
mutex_unlock(&selinux_state.policy_mutex);
mutex_lock(&selinux_state.policy_mutex);
mutex_unlock(&selinux_state.policy_mutex);
policy = rcu_dereference(selinux_state.policy);
policy = rcu_dereference(selinux_state.policy);
policy = rcu_dereference(selinux_state.policy);
policy = rcu_dereference(selinux_state.policy);
policy = rcu_dereference(selinux_state.policy);
policy = rcu_dereference(selinux_state.policy);
policy = rcu_dereference(selinux_state.policy);
for (i = 0; i < ARRAY_SIZE(selinux_state.policycap); i++)
WRITE_ONCE(selinux_state.policycap[i],
struct selinux_state *state = &selinux_state;
struct selinux_state *state = &selinux_state;
struct selinux_state *state = &selinux_state;
policy = rcu_dereference(selinux_state.policy);
policy = rcu_dereference(selinux_state.policy);
policy = rcu_dereference(selinux_state.policy);
policy = rcu_dereference(selinux_state.policy);
policy = rcu_dereference(selinux_state.policy);
policy = rcu_dereference(selinux_state.policy);
policy = rcu_dereference(selinux_state.policy);
policy = rcu_dereference(selinux_state.policy);
policy = rcu_dereference(selinux_state.policy);
struct selinux_state *state = &selinux_state;
policy = rcu_dereference(selinux_state.policy);
policy = rcu_dereference(selinux_state.policy);
policy = rcu_dereference(selinux_state.policy);
policy = rcu_dereference(selinux_state.policy);
policy = rcu_dereference(selinux_state.policy);
policy = rcu_dereference(selinux_state.policy);
struct selinux_state *state = &selinux_state;
struct selinux_state *state = &selinux_state;
policy = rcu_dereference(selinux_state.policy);
policy = rcu_dereference(selinux_state.policy);
struct selinux_state *state = &selinux_state;
struct selinux_state *state = &selinux_state;
policy = rcu_dereference(selinux_state.policy);
policy = rcu_dereference(selinux_state.policy);
mutex_lock(&selinux_state.status_lock);
if (selinux_state.status_page) {
status = page_address(selinux_state.status_page);
mutex_unlock(&selinux_state.status_lock);
mutex_lock(&selinux_state.status_lock);
if (!selinux_state.status_page) {
selinux_state.status_page = alloc_page(GFP_KERNEL|__GFP_ZERO);
if (selinux_state.status_page) {
status = page_address(selinux_state.status_page);
result = selinux_state.status_page;
mutex_unlock(&selinux_state.status_lock);
mutex_lock(&selinux_state.status_lock);
if (selinux_state.status_page) {
status = page_address(selinux_state.status_page);
mutex_unlock(&selinux_state.status_lock);