aboutsummaryrefslogtreecommitdiffstats
path: root/security/device_cgroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/device_cgroup.c')
-rw-r--r--security/device_cgroup.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/security/device_cgroup.c b/security/device_cgroup.c
index 4450fbeec411..8b5b5d8612c6 100644
--- a/security/device_cgroup.c
+++ b/security/device_cgroup.c
@@ -62,11 +62,12 @@ static inline struct dev_cgroup *task_devcgroup(struct task_struct *task)
62struct cgroup_subsys devices_subsys; 62struct cgroup_subsys devices_subsys;
63 63
64static int devcgroup_can_attach(struct cgroup_subsys *ss, 64static int devcgroup_can_attach(struct cgroup_subsys *ss,
65 struct cgroup *new_cgroup, struct task_struct *task) 65 struct cgroup *new_cgrp, struct cgroup_taskset *set)
66{ 66{
67 if (current != task && !capable(CAP_SYS_ADMIN)) 67 struct task_struct *task = cgroup_taskset_first(set);
68 return -EPERM;
69 68
69 if (current != task && !capable(CAP_SYS_ADMIN))
70 return -EPERM;
70 return 0; 71 return 0;
71} 72}
72 73