diff options
author | Serge Hallyn <serge.hallyn@ubuntu.com> | 2013-10-22 19:34:00 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-10-24 06:56:56 -0400 |
commit | 73ba353471e0b692f398f3d63018b7f46ccf1d3e (patch) | |
tree | 132a9cc3ca7d329adb0b3f54d9b7f086db388f7f /security/device_cgroup.c | |
parent | 2ff2a7d03bbe472ed44a8380dbdbea490d81c59d (diff) |
device_cgroup: remove can_attach
It is really only wanting to duplicate a check which is already done by the
cgroup subsystem.
With this patch, user jdoe still cannot move pid 1 into a devices cgroup
he owns, but now he can move his own other tasks into devices cgroups.
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Aristeu Rozanski <aris@redhat.com>
Diffstat (limited to 'security/device_cgroup.c')
-rw-r--r-- | security/device_cgroup.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/security/device_cgroup.c b/security/device_cgroup.c index c123628d3f84..7c2a0a71049e 100644 --- a/security/device_cgroup.c +++ b/security/device_cgroup.c | |||
@@ -63,16 +63,6 @@ static inline struct dev_cgroup *task_devcgroup(struct task_struct *task) | |||
63 | 63 | ||
64 | struct cgroup_subsys devices_subsys; | 64 | struct cgroup_subsys devices_subsys; |
65 | 65 | ||
66 | static int devcgroup_can_attach(struct cgroup_subsys_state *new_css, | ||
67 | struct cgroup_taskset *set) | ||
68 | { | ||
69 | struct task_struct *task = cgroup_taskset_first(set); | ||
70 | |||
71 | if (current != task && !capable(CAP_SYS_ADMIN)) | ||
72 | return -EPERM; | ||
73 | return 0; | ||
74 | } | ||
75 | |||
76 | /* | 66 | /* |
77 | * called under devcgroup_mutex | 67 | * called under devcgroup_mutex |
78 | */ | 68 | */ |
@@ -697,7 +687,6 @@ static struct cftype dev_cgroup_files[] = { | |||
697 | 687 | ||
698 | struct cgroup_subsys devices_subsys = { | 688 | struct cgroup_subsys devices_subsys = { |
699 | .name = "devices", | 689 | .name = "devices", |
700 | .can_attach = devcgroup_can_attach, | ||
701 | .css_alloc = devcgroup_css_alloc, | 690 | .css_alloc = devcgroup_css_alloc, |
702 | .css_free = devcgroup_css_free, | 691 | .css_free = devcgroup_css_free, |
703 | .css_online = devcgroup_online, | 692 | .css_online = devcgroup_online, |