Skip to content

Commit

Permalink
device_cgroup: remove can_attach
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
Cc: Aristeu Rozanski <[email protected]>
  • Loading branch information
hallyn authored and htejun committed Oct 24, 2013
1 parent 2ff2a7d commit 73ba353
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions security/device_cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,6 @@ static inline struct dev_cgroup *task_devcgroup(struct task_struct *task)

struct cgroup_subsys devices_subsys;

static int devcgroup_can_attach(struct cgroup_subsys_state *new_css,
struct cgroup_taskset *set)
{
struct task_struct *task = cgroup_taskset_first(set);

if (current != task && !capable(CAP_SYS_ADMIN))
return -EPERM;
return 0;
}

/*
* called under devcgroup_mutex
*/
Expand Down Expand Up @@ -697,7 +687,6 @@ static struct cftype dev_cgroup_files[] = {

struct cgroup_subsys devices_subsys = {
.name = "devices",
.can_attach = devcgroup_can_attach,
.css_alloc = devcgroup_css_alloc,
.css_free = devcgroup_css_free,
.css_online = devcgroup_online,
Expand Down

0 comments on commit 73ba353

Please sign in to comment.