summaryrefslogtreecommitdiff
path: root/security/yama
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2018-09-14 15:37:20 -0700
committerKees Cook <keescook@chromium.org>2019-01-08 13:18:43 -0800
commitd6aed64b74b73b64278c059eacd59d87167aa968 (patch)
tree0fd4b2e95d633d09a9f3d7e3711aeab68d328e88 /security/yama
parent70b62c25665f636c9f6c700b26af7df296b0887e (diff)
Yama: Initialize as ordered LSM
This converts Yama from being a direct "minor" LSM into an ordered LSM. Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-by: Casey Schaufler <casey@schaufler-ca.com>
Diffstat (limited to 'security/yama')
-rw-r--r--security/yama/yama_lsm.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/security/yama/yama_lsm.c b/security/yama/yama_lsm.c
index ffda91a4a1aa..eb1da1303d2e 100644
--- a/security/yama/yama_lsm.c
+++ b/security/yama/yama_lsm.c
@@ -477,9 +477,15 @@ static void __init yama_init_sysctl(void)
static inline void yama_init_sysctl(void) { }
#endif /* CONFIG_SYSCTL */
-void __init yama_add_hooks(void)
+static int __init yama_init(void)
{
pr_info("Yama: becoming mindful.\n");
security_add_hooks(yama_hooks, ARRAY_SIZE(yama_hooks), "yama");
yama_init_sysctl();
+ return 0;
}
+
+DEFINE_LSM(yama) = {
+ .name = "yama",
+ .init = yama_init,
+};