Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8718739 authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Amit Pundir
Browse files

CHROMIUM: cgroups: relax permissions on moving tasks between cgroups



Android expects system_server to be able to move tasks between different
cgroups/cpusets, but does not want to be running as root. Let's relax
permission check so that processes can move other tasks if they have
CAP_SYS_NICE in the affected task's user namespace.

BUG=b:31790445,chromium:647994
TEST=Boot android container, examine logcat

Change-Id: Ia919c66ab6ed6a6daf7c4cf67feb38b13b1ad09b
Signed-off-by: default avatarDmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/394927


Reviewed-by: default avatarRicky Zhou <rickyz@chromium.org>
Signed-off-by: default avatarAmit Pundir <amit.pundir@linaro.org>
parent 487c9894
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2364,7 +2364,8 @@ retry_find_task:
		tcred = __task_cred(tsk);
		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)) {
			rcu_read_unlock();
			ret = -EACCES;
			goto out_unlock_cgroup;