]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - security/selinux/hooks.c
Merge branch 'stable-4.10' of git://git.infradead.org/users/pcmoore/selinux into...
[mirror_ubuntu-bionic-kernel.git] / security / selinux / hooks.c
index aa22a5ef5b05e297d8e484db8ec6a39a49d89d1f..424573029c5c09a59de016dcae6afbe2bc4e9c0f 100644 (file)
@@ -2538,7 +2538,8 @@ static void selinux_bprm_committing_creds(struct linux_binprm *bprm)
                        rlim->rlim_cur = min(rlim->rlim_max, initrlim->rlim_cur);
                }
                task_unlock(current);
-               update_rlimit_cpu(current, rlimit(RLIMIT_CPU));
+               if (IS_ENABLED(CONFIG_POSIX_TIMERS))
+                       update_rlimit_cpu(current, rlimit(RLIMIT_CPU));
        }
 }
 
@@ -2568,9 +2569,11 @@ static void selinux_bprm_committed_creds(struct linux_binprm *bprm)
         */
        rc = avc_has_perm(osid, sid, SECCLASS_PROCESS, PROCESS__SIGINH, NULL);
        if (rc) {
-               memset(&itimer, 0, sizeof itimer);
-               for (i = 0; i < 3; i++)
-                       do_setitimer(i, &itimer, NULL);
+               if (IS_ENABLED(CONFIG_POSIX_TIMERS)) {
+                       memset(&itimer, 0, sizeof itimer);
+                       for (i = 0; i < 3; i++)
+                               do_setitimer(i, &itimer, NULL);
+               }
                spin_lock_irq(&current->sighand->siglock);
                if (!fatal_signal_pending(current)) {
                        flush_sigqueue(&current->pending);
@@ -6346,7 +6349,7 @@ static __init int selinux_init(void)
                                            0, SLAB_PANIC, NULL);
        avc_init();
 
-       security_add_hooks(selinux_hooks, ARRAY_SIZE(selinux_hooks));
+       security_add_hooks(selinux_hooks, ARRAY_SIZE(selinux_hooks), "selinux");
 
        if (avc_add_callback(selinux_netcache_avc_callback, AVC_CALLBACK_RESET))
                panic("SELinux: Unable to register AVC netcache callback\n");