cgroup: update some statememt about delegation
Subsystems (2)
PATCH v2 1/1 cgroup: update some statememt about delegation
The comment in cgroup_file_write is missing some interfaces, such as 'cgroup.threads'. All delegatable files are listed in '/sys/kernel/cgroup/delegate', so update the comment in cgroup_file_write. Besides, add a statement that files outside the namespace shouldn't be visible from inside the delegated namespace.
--- Documentation/admin-guide/cgroup-v2.rst | 10 ++++++---- kernel/cgroup/cgroup.c | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-)
Documentation/admin-guide/cgroup-v2.rst +6 -4
@@ -533,10 +533,12 @@ cgroup namespace on namespace creation. Because the resource control interface files in a given directory control the distribution of the parent's resources, the delegatee shouldn't be allowed to write to them. For the first method, this is -achieved by not granting access to these files. For the second, the -kernel rejects writes to all files other than "cgroup.procs" and -"cgroup.subtree_control" on a namespace root from inside the -namespace. +achieved by not granting access to these files. For the second, files +outside the namespace should be hidden from the delegatee by the means +of at least mount namespacing, and the kernel rejects writes to all files +on a namespace root from inside the cgroup namespace, except for those +files listed in "/sys/kernel/cgroup/delegate" (including "cgroup.procs", +"cgroup.threads", "cgroup.subtree_control", etc.). The end results are equivalent for both delegation types. Once delegated, the user can build sub-hierarchy under the directory,
kernel/cgroup/cgroup.c +1 -1
@@ -4131,7 +4131,7 @@ static ssize_t cgroup_file_write(struct kernfs_open_file *of, char *buf,* If namespaces are delegation boundaries, disallow writes to * files in an non-init namespace root from inside the namespace * except for the files explicitly marked delegatable - -* cgroup.procs and cgroup.subtree_control. +* eg. cgroup.procs, cgroup.threads and cgroup.subtree_control. */ if ((cgrp->root->flags & CGRP_ROOT_NS_DELEGATE) && !(cft->flags & CFTYPE_NS_DELEGATABLE) &&
Signature · 1 line
2.34.1
Quoted 7 lines · Chen Ridong
The comment in
cgroup_file_writeis missing some interfaces, such as 'cgroup.threads'. All delegatable files are listed in '/sys/kernel/cgroup/delegate', so update the comment incgroup_file_write. Besides, add a statement that files outside the namespace shouldn't be visible from inside the delegated namespace.Signed-off-by Chen Ridong <[email protected]>
Applied to cgroup/for-6.12 w/ text reflowed for consistency.
Thanks.
Signature · 1 line
tejun
Quoted 11 lines · Chen Ridong
The comment in
cgroup_file_writeis missing some interfaces, such as 'cgroup.threads'. All delegatable files are listed in '/sys/kernel/cgroup/delegate', so update the comment incgroup_file_write. Besides, add a statement that files outside the namespace shouldn't be visible from inside the delegated namespace.Signed-off-by Chen Ridong <[email protected]>--- Documentation/admin-guide/cgroup-v2.rst | 10 ++++++---- kernel/cgroup/cgroup.c | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-)