diff options
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r-- | include/linux/cgroup.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 9450f025fe0c..1edbda9e0773 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -579,6 +579,8 @@ struct cgroup_subsys { void (*css_offline)(struct cgroup_subsys_state *css); void (*css_free)(struct cgroup_subsys_state *css); + int (*allow_attach)(struct cgroup_subsys_state *css, + struct cgroup_taskset *tset); int (*can_attach)(struct cgroup_subsys_state *css, struct cgroup_taskset *tset); void (*cancel_attach)(struct cgroup_subsys_state *css, @@ -848,6 +850,17 @@ int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from); struct cgroup_subsys_state *css_from_dir(struct dentry *dentry, struct cgroup_subsys *ss); +/* + * Default Android check for whether the current process is allowed to move a + * task across cgroups, either because CAP_SYS_NICE is set or because the uid + * of the calling process is the same as the moved task or because we are + * running as root. + * Returns 0 if this is allowed, or -EACCES otherwise. + */ +int subsys_cgroup_allow_attach(struct cgroup_subsys_state *css, + struct cgroup_taskset *tset); + + #else /* !CONFIG_CGROUPS */ static inline int cgroup_init_early(void) { return 0; } @@ -869,6 +882,11 @@ static inline int cgroup_attach_task_all(struct task_struct *from, return 0; } +static inline int subsys_cgroup_allow_attach(struct cgroup_subsys_state *css, + void *tset) +{ + return 0; +} #endif /* !CONFIG_CGROUPS */ #endif /* _LINUX_CGROUP_H */ |