diff options
author | Colin Cross <ccross@android.com> | 2011-07-12 20:12:45 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:38:49 -0800 |
commit | f971f6c015d74c9653a15fa1357144ead2ff7e7e (patch) | |
tree | 4d63f413c23ec28c48998accba2a308708ca225f /kernel | |
parent | c39f2e08a71167754a0949f64e95c0a03525af61 (diff) |
Revert "cgroup: Add generic cgroup subsystem permission checks."
This reverts commit 1d38bc7d0523af2233b4280e2aeab34c6a076665.
Change-Id: I2c5066b696cbdd5ca117ed74718bcb7e70e878e7
Signed-off-by: Colin Cross <ccross@android.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/cgroup.c | 10 | ||||
-rw-r--r-- | kernel/cgroup_freezer.c | 8 | ||||
-rw-r--r-- | kernel/cpuset.c | 7 | ||||
-rw-r--r-- | kernel/sched.c | 9 |
4 files changed, 0 insertions, 34 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 58e9d298165d..84dd3818633f 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -60,7 +60,6 @@ #include <linux/eventfd.h> #include <linux/poll.h> #include <linux/flex_array.h> /* used in cgroup_attach_proc */ -#include <linux/capability.h> #include <linux/atomic.h> @@ -1847,15 +1846,6 @@ int cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk) failed_ss = ss; goto out; } - } else if (!capable(CAP_SYS_ADMIN)) { - const struct cred *cred = current_cred(), *tcred; - - /* No can_attach() - check perms generically */ - tcred = __task_cred(tsk); - if (cred->euid != tcred->uid && - cred->euid != tcred->suid) { - return -EACCES; - } } if (ss->can_attach_task) { retval = ss->can_attach_task(cgrp, tsk); diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c index 6ebda1df9b70..e691818d7e45 100644 --- a/kernel/cgroup_freezer.c +++ b/kernel/cgroup_freezer.c @@ -164,14 +164,6 @@ static int freezer_can_attach(struct cgroup_subsys *ss, { struct freezer *freezer; - if ((current != task) && (!capable(CAP_SYS_ADMIN))) { - const struct cred *cred = current_cred(), *tcred; - - tcred = __task_cred(task); - if (cred->euid != tcred->uid && cred->euid != tcred->suid) - return -EPERM; - } - /* * Anything frozen can't move or be moved to/from. */ diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 3b2305163da4..10131fdaff70 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -1373,13 +1373,6 @@ static int cpuset_can_attach(struct cgroup_subsys *ss, struct cgroup *cont, { struct cpuset *cs = cgroup_cs(cont); - if ((current != task) && (!capable(CAP_SYS_ADMIN))) { - const struct cred *cred = current_cred(), *tcred; - - if (cred->euid != tcred->uid && cred->euid != tcred->suid) - return -EPERM; - } - if (cpumask_empty(cs->cpus_allowed) || nodes_empty(cs->mems_allowed)) return -ENOSPC; diff --git a/kernel/sched.c b/kernel/sched.c index 27ee31e5673e..7de220e79dff 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -8968,15 +8968,6 @@ cpu_cgroup_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp) static int cpu_cgroup_can_attach_task(struct cgroup *cgrp, struct task_struct *tsk) { - if ((current != tsk) && (!capable(CAP_SYS_NICE))) { - const struct cred *cred = current_cred(), *tcred; - - tcred = __task_cred(tsk); - - if (cred->euid != tcred->uid && cred->euid != tcred->suid) - return -EPERM; - } - #ifdef CONFIG_RT_GROUP_SCHED if (!sched_rt_can_attach(cgroup_tg(cgrp), tsk)) return -EINVAL; |