]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blobdiff - security/tomoyo/tomoyo.c
LSM: Switch to lists of hooks
[mirror_ubuntu-hirsute-kernel.git] / security / tomoyo / tomoyo.c
index bce13583efda8cc96f6c41a20964d1474df9d1ca..cbf3df422c8724576a503b7eb4e341a934ed83d0 100644 (file)
@@ -72,12 +72,6 @@ static void tomoyo_cred_free(struct cred *cred)
  */
 static int tomoyo_bprm_set_creds(struct linux_binprm *bprm)
 {
-       int rc;
-
-       rc = cap_bprm_set_creds(bprm);
-       if (rc)
-               return rc;
-
        /*
         * Do only if this function is called for the first time of an execve
         * operation.
@@ -502,8 +496,7 @@ static int tomoyo_socket_sendmsg(struct socket *sock, struct msghdr *msg,
  * tomoyo_security_ops is a "struct security_operations" which is used for
  * registering TOMOYO.
  */
-static struct security_operations tomoyo_security_ops = {
-       LSM_HOOK_INIT(name, "tomoyo"),
+static struct security_hook_list tomoyo_hooks[] = {
        LSM_HOOK_INIT(cred_alloc_blank, tomoyo_cred_alloc_blank),
        LSM_HOOK_INIT(cred_prepare, tomoyo_cred_prepare),
        LSM_HOOK_INIT(cred_transfer, tomoyo_cred_transfer),
@@ -546,11 +539,10 @@ static int __init tomoyo_init(void)
 {
        struct cred *cred = (struct cred *) current_cred();
 
-       if (!security_module_enable(&tomoyo_security_ops))
+       if (!security_module_enable("tomoyo"))
                return 0;
        /* register ourselves with the security framework */
-       if (register_security(&tomoyo_security_ops))
-               panic("Failure registering TOMOYO Linux");
+       security_add_hooks(tomoyo_hooks, ARRAY_SIZE(tomoyo_hooks));
        printk(KERN_INFO "TOMOYO Linux initialized\n");
        cred->security = &tomoyo_kernel_domain;
        tomoyo_mm_init();