CHROMIUM: cgroups: relax permissions on moving tasks between cgroups
[firefly-linux-kernel-4.4.55.git] / kernel / cgroup.c
index fec27295a1eca79960f2eab245a1f86f7893684d..fcb037068e3f862b8ad4d9bae84fac51f38cc3ff 100644 (file)
@@ -2685,7 +2685,8 @@ static int cgroup_procs_write_permission(struct task_struct *task,
         */
        if (!uid_eq(cred->euid, GLOBAL_ROOT_UID) &&
            !uid_eq(cred->euid, tcred->uid) &&
-           !uid_eq(cred->euid, tcred->suid))
+           !uid_eq(cred->euid, tcred->suid) &&
+           !ns_capable(tcred->user_ns, CAP_SYS_NICE))
                ret = -EACCES;
 
        if (!ret && cgroup_on_dfl(dst_cgrp)) {