summaryrefslogtreecommitdiff
path: root/security/selinux
diff options
context:
space:
mode:
authorPaul Moore <paul@paul-moore.com>2023-06-16 18:02:43 -0400
committerPaul Moore <paul@paul-moore.com>2023-07-10 14:23:56 -0400
commitd91c1ab470edd94e52bca738e53b5ad0f0247176 (patch)
treef017d1f9abca81d715e110ccdbd6f9b52e92c113 /security/selinux
parent06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5 (diff)
selinux: cleanup the policycap accessor functions
In the process of reverting back to directly accessing the global selinux_state pointer we left behind some artifacts in the selinux_policycap_XXX() helper functions. This patch cleans up some of that left-behind cruft. Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/selinux')
-rw-r--r--security/selinux/include/security.h35
1 files changed, 11 insertions, 24 deletions
diff --git a/security/selinux/include/security.h b/security/selinux/include/security.h
index 3b605f39e040..60eb161a0e5a 100644
--- a/security/selinux/include/security.h
+++ b/security/selinux/include/security.h
@@ -148,58 +148,45 @@ static inline bool checkreqprot_get(void)
static inline bool selinux_policycap_netpeer(void)
{
- struct selinux_state *state = &selinux_state;
-
- return READ_ONCE(state->policycap[POLICYDB_CAP_NETPEER]);
+ return READ_ONCE(selinux_state.policycap[POLICYDB_CAP_NETPEER]);
}
static inline bool selinux_policycap_openperm(void)
{
- struct selinux_state *state = &selinux_state;
-
- return READ_ONCE(state->policycap[POLICYDB_CAP_OPENPERM]);
+ return READ_ONCE(selinux_state.policycap[POLICYDB_CAP_OPENPERM]);
}
static inline bool selinux_policycap_extsockclass(void)
{
- struct selinux_state *state = &selinux_state;
-
- return READ_ONCE(state->policycap[POLICYDB_CAP_EXTSOCKCLASS]);
+ return READ_ONCE(selinux_state.policycap[POLICYDB_CAP_EXTSOCKCLASS]);
}
static inline bool selinux_policycap_alwaysnetwork(void)
{
- struct selinux_state *state = &selinux_state;
-
- return READ_ONCE(state->policycap[POLICYDB_CAP_ALWAYSNETWORK]);
+ return READ_ONCE(selinux_state.policycap[POLICYDB_CAP_ALWAYSNETWORK]);
}
static inline bool selinux_policycap_cgroupseclabel(void)
{
- struct selinux_state *state = &selinux_state;
-
- return READ_ONCE(state->policycap[POLICYDB_CAP_CGROUPSECLABEL]);
+ return READ_ONCE(selinux_state.policycap[POLICYDB_CAP_CGROUPSECLABEL]);
}
static inline bool selinux_policycap_nnp_nosuid_transition(void)
{
- struct selinux_state *state = &selinux_state;
-
- return READ_ONCE(state->policycap[POLICYDB_CAP_NNP_NOSUID_TRANSITION]);
+ return READ_ONCE(
+ selinux_state.policycap[POLICYDB_CAP_NNP_NOSUID_TRANSITION]);
}
static inline bool selinux_policycap_genfs_seclabel_symlinks(void)
{
- struct selinux_state *state = &selinux_state;
-
- return READ_ONCE(state->policycap[POLICYDB_CAP_GENFS_SECLABEL_SYMLINKS]);
+ return READ_ONCE(
+ selinux_state.policycap[POLICYDB_CAP_GENFS_SECLABEL_SYMLINKS]);
}
static inline bool selinux_policycap_ioctl_skip_cloexec(void)
{
- struct selinux_state *state = &selinux_state;
-
- return READ_ONCE(state->policycap[POLICYDB_CAP_IOCTL_SKIP_CLOEXEC]);
+ return READ_ONCE(
+ selinux_state.policycap[POLICYDB_CAP_IOCTL_SKIP_CLOEXEC]);
}
struct selinux_policy_convert_data;