summaryrefslogtreecommitdiffstats
path: root/security/commoncap.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2018-09-14 15:40:45 -0700
committerKees Cook <keescook@chromium.org>2019-01-08 13:18:44 -0800
commitd117a154e6128abac5409d3f173584e7b25981a2 (patch)
tree86a2adfff727e41102deedc94488559bd8759522 /security/commoncap.c
parente2bc445b66cad25b0627391df8138a83d0e48f97 (diff)
downloadlinux-d117a154e6128abac5409d3f173584e7b25981a2.tar.gz
linux-d117a154e6128abac5409d3f173584e7b25981a2.tar.bz2
linux-d117a154e6128abac5409d3f173584e7b25981a2.zip
capability: Initialize as LSM_ORDER_FIRST
This converts capabilities to use the new LSM_ORDER_FIRST position. Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-by: Casey Schaufler <casey@schaufler-ca.com>
Diffstat (limited to 'security/commoncap.c')
-rw-r--r--security/commoncap.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/security/commoncap.c b/security/commoncap.c
index 232db019f051..52e04136bfa8 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -1362,10 +1362,17 @@ struct security_hook_list capability_hooks[] __lsm_ro_after_init = {
LSM_HOOK_INIT(vm_enough_memory, cap_vm_enough_memory),
};
-void __init capability_add_hooks(void)
+static int __init capability_init(void)
{
security_add_hooks(capability_hooks, ARRAY_SIZE(capability_hooks),
"capability");
+ return 0;
}
+DEFINE_LSM(capability) = {
+ .name = "capability",
+ .order = LSM_ORDER_FIRST,
+ .init = capability_init,
+};
+
#endif /* CONFIG_SECURITY */