Hi,
following is a revised set of the CGroup Namespace patchset which Aditya
Kali has previously sent. The code can also be found in the cgroupns.v8
branch of
https://git.kernel.org/cgit/linux/kernel/git/sergeh/linux-security.git/
To summarize the semantics:
1. CLONE_NEWCGROUP re-uses 0x02000000, which was previously CLONE_STOPPED
2. unsharing a cgroup namespace makes all your current cgroups your new
cgroup root.
3. /proc/pid/cgroup always shows cgroup paths relative to the reader's
cgroup namespce root. A task outside of your cgroup looks like
8:memory:/../../..
4. when a task mounts a cgroupfs, the cgroup which shows up as root depends
on the mounting task's cgroup namespace.
5. setns to a cgroup namespace switches your cgroup namespace but not
your cgroups.
With this, using github.com/hallyn/lxc #2015-11-09/cgns (and
github.com/hallyn/lxcfs #2015-11-10/cgns) we can start a container in a full
proper cgroup namespace, avoiding either cgmanager or lxcfs cgroup bind mounts.
This is completely backward compatible and will be completely invisible
to any existing cgroup users (except for those running inside a cgroup
namespace and looking at /proc/pid/cgroup of tasks outside their
namespace.)
Changes from V7:
1. Rework kernfs_path_from_node_locked to return the string length
2. Rename and reorder args to kernfs_path_from_node
3. cgroup.c: undo accidental conversoins to inline
4. cgroup.h: move ns declarations to bottom.
5. Rework the documentation to fit the style of the rest of cgroup.txt
Changes from V6:
1. Switch to some WARN_ONs to provide stack traces
2. Rename kernfs_node_distance to kernfs_depth
3. Make sure kernfs_common_ancestor() nodes are from same root
4. Split kernfs changes for cgroup_mount into separate patch
5. Rename kernfs_obtain_root to kernfs_node_dentry
(And more, see patch changelogs)
Changes from V5:
1. To get a root dentry for cgroup namespace mount, walk the path from the
kernfs root dentry.
Changes from V4:
1. Move the FS_USERNS_MOUNT flag to last patch
2. Rebase onto cgroup/for-4.5
3. Don't non-init user namespaces to bind new subsystems when mounting.
4. Address feedback from Tejun (thanks). Specificaly, not addressed:
. kernfs_obtain_root - walking dentry from kernfs root.
(I think that's the only piece)
5. Dropped unused get_task_cgroup fn/patch.
6. Reworked kernfs_path_from_node_locked() to try to simplify the logic.
It now finds a common ancestor, walks from the source to it, then back
up to the target.
Changes from V3:
1. Rebased onto latest cgroup changes. In particular switch to
css_set_lock and ns_common.
2. Support all hierarchies.
Changes from V2:
1. Added documentation in Documentation/cgroups/namespace.txt
2. Fixed a bug that caused crash
3. Incorporated some other suggestions from last patchset:
- removed use of threadgroup_lock() while creating new cgroupns
- use task_lock() instead of rcu_read_lock() while accessing
task->nsproxy
- optimized setns() to own cgroupns
- simplified code around sane-behavior mount option parsing
4. Restored ACKs from Serge Hallyn from v1 on few patches that have
not changed since then.
Changes from V1:
1. No pinning of processes within cgroupns. Tasks can be freely moved
across cgroups even outside of their cgroupns-root. Usual DAC/MAC policies
apply as before.
2. Path in /proc/<pid>/cgroup is now always shown and is relative to
cgroupns-root. So path can contain '/..' strings depending on cgroupns-root
of the reader and cgroup of <pid>.
3. setns() does not require the process to first move under target
cgroupns-root.
Changes form RFC (V0):
1. setns support for cgroupns
2. 'mount -t cgroup cgroup <mntpt>' from inside a cgroupns now
mounts the cgroup hierarcy with cgroupns-root as the filesystem root.
3. writes to cgroup files outside of cgroupns-root are not allowed
4. visibility of /proc/<pid>/cgroup is further restricted by not showing
anything if the <pid> is in a sibling cgroupns and its cgroup falls outside
your cgroupns-root.
From: Aditya Kali <redacted>
setns on a cgroup namespace is allowed only if
task has CAP_SYS_ADMIN in its current user-namespace and
over the user-namespace associated with target cgroupns.
No implicit cgroup changes happen with attaching to another
cgroupns. It is expected that the somone moves the attaching
process under the target cgroupns-root.
Signed-off-by: Aditya Kali <redacted>
Signed-off-by: Serge E. Hallyn <redacted>
---
kernel/cgroup.c | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
@@ -5925,10 +5925,28 @@ err_out:returnERR_PTR(err);}-staticintcgroupns_install(structnsproxy*nsproxy,void*ns)+staticinlinestructcgroup_namespace*to_cg_ns(structns_common*ns){-pr_info("setns not supported for cgroup namespace");-return-EINVAL;+returncontainer_of(ns,structcgroup_namespace,ns);+}++staticintcgroupns_install(structnsproxy*nsproxy,structns_common*ns)+{+structcgroup_namespace*cgroup_ns=to_cg_ns(ns);++if(!ns_capable(current_user_ns(),CAP_SYS_ADMIN)||+!ns_capable(cgroup_ns->user_ns,CAP_SYS_ADMIN))+return-EPERM;++/* Don't need to do anything if we are attaching to our own cgroupns. */+if(cgroup_ns==nsproxy->cgroup_ns)+return0;++get_cgroup_ns(cgroup_ns);+put_cgroup_ns(nsproxy->cgroup_ns);+nsproxy->cgroup_ns=cgroup_ns;++return0;}staticstructns_common*cgroupns_get(structtask_struct*task)
From: Aditya Kali <redacted>
CLONE_NEWCGROUP will be used to create new cgroup namespace.
Signed-off-by: Aditya Kali <redacted>
Signed-off-by: Serge Hallyn <redacted>
---
include/uapi/linux/sched.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
@@ -21,8 +21,7 @@#define CLONE_DETACHED 0x00400000 /* Unused, ignored */#define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */#define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */-/* 0x02000000 was previously the unused CLONE_STOPPED (Start in stopped state)-andisnowavailableforre-use.*/+#define CLONE_NEWCGROUP 0x02000000 /* New cgroup namespace */#define CLONE_NEWUTS 0x04000000 /* New utsname namespace */#define CLONE_NEWIPC 0x08000000 /* New ipc namespace */#define CLONE_NEWUSER 0x10000000 /* New user namespace */
From: Aditya Kali <redacted>
Signed-off-by: Aditya Kali <redacted>
Signed-off-by: Serge Hallyn <redacted>
---
Changelog (2015-12-08):
Merge into Documentation/cgroup.txt
Changelog (2015-12-22):
Reformat to try to follow the style of the rest of the cgroup.txt file.
Signed-off-by: Serge Hallyn <serge.hallyn-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
---
Documentation/cgroup.txt | 150 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 150 insertions(+)
@@ -47,6 +47,7 @@ CONTENTS 5-3. IO 5-3-1. IO Interface Files 5-3-2. Writeback+6. Namespaces P. Information on Kernel Programming P-1. Filesystem Support for Writeback D. Deprecated v1 Core Features
@@ -1013,6 +1014,155 @@ writeback as follows. vm.dirty[_background]_ratio.+6. Cgroup Namespaces++Cgroup namespaces provides a mechanism to virtualize the view of the+"/proc/$PID/cgroup" file. The CLONE_NEWCGROUP clone flag can be used with+clone() and unshare() syscalls to create a new cgroup namespace. The process+running inside the cgroup namespace will have its "/proc/$PID/cgroup" output+restricted to cgroupns root. The cgroupns root is the cgroup of the process at+the time of creation of the cgroup namespace.++Prior to cgroup namespaces, the "/proc/$PID/cgroup" file showed the complete+path of the cgroup of a process. In a container setup where a set of cgroups+and namespaces are intended to isolate processes the "/proc/$PID/cgroup" file+may leak potential system level information to the isolated processes.++For Example:+ # cat /proc/self/cgroup+ 0:cpuset,cpu,cpuacct,memory,devices,freezer,hugetlb:/batchjobs/container_id1++The path '/batchjobs/container_id1' can generally be considered as system-data+and its desirable to not expose it to the isolated process.++Cgroup namespaces can be used to restrict visibility of this path.+For example, before creating a cgroup namespace, one would see:++ # ls -l /proc/self/ns/cgroup+ lrwxrwxrwx 1 root root 0 2014-07-15 10:37 /proc/self/ns/cgroup -> cgroup:[4026531835]+ # cat /proc/self/cgroup+ 0:cpuset,cpu,cpuacct,memory,devices,freezer,hugetlb:/batchjobs/container_id1++After unsharing a new namespace, the view has changed.++ # ls -l /proc/self/ns/cgroup+ lrwxrwxrwx 1 root root 0 2014-07-15 10:35 /proc/self/ns/cgroup -> cgroup:[4026532183]+ # cat /proc/self/cgroup+ 0:cpuset,cpu,cpuacct,memory,devices,freezer,hugetlb:/++While a task in the global cgroup namespace sees the full path.++ # cat /proc/$PID/cgroup+ 0:cpuset,cpu,cpuacct,memory,devices,freezer,hugetlb:/batchjobs/container_id1++If also unsharing the user and mounts namespaces, then when mounting cgroupfs+then the mount's root will be the task's cgroup.++ # lxc-usernsexec --unshare -m -c+ # mount -t cgroup cgroup /tmp/cgroup+ # ls -l /tmp/cgroup+ total 0+ -r--r--r-- 1 root root 0 2014-10-13 09:32 cgroup.controllers+ -r--r--r-- 1 root root 0 2014-10-13 09:32 cgroup.populated+ -rw-r--r-- 1 root root 0 2014-10-13 09:25 cgroup.procs+ -rw-r--r-- 1 root root 0 2014-10-13 09:32 cgroup.subtree_control++The cgroupns root (/batchjobs/container_id1 in above example) becomes the+filesystem root for the namespace specific cgroupfs mount.++The virtualization of /proc/self/cgroup file combined with restricting+the view of cgroup hierarchy by namespace-private cgroupfs mount+should provide a completely isolated cgroup view inside the container.++In its current form, the cgroup namespaces patcheset provides following+behavior:++(1) The 'cgroupns root' for a cgroup namespace is the cgroup in which+ the process calling unshare is running.+ For ex. if a process in /batchjobs/container_id1 cgroup calls unshare,+ cgroup /batchjobs/container_id1 becomes the cgroupns root.+ For the init_cgroup_ns, this is the real root ('/') cgroup+ (identified in code as cgrp_dfl_root.cgrp).++(2) The cgroupns root cgroup does not change even if the namespace+ creator process later moves to a different cgroup.+ # ~/unshare -c # unshare cgroupns in some cgroup+ # cat /proc/self/cgroup+ 0:cpuset,cpu,cpuacct,memory,devices,freezer,hugetlb:/+ # mkdir sub_cgrp_1+ # echo 0 > sub_cgrp_1/cgroup.procs+ # cat /proc/self/cgroup+ 0:cpuset,cpu,cpuacct,memory,devices,freezer,hugetlb:/sub_cgrp_1++(3) Each process gets its namespace-specific view of "/proc/$PID/cgroup"++(a) Processes running inside the cgroup namespace will be able to see+ cgroup paths (in /proc/self/cgroup) only inside their root cgroup.+ From within an unshared cgroupns:+ # sleep 100000 &+ [1] 7353+ # echo 7353 > sub_cgrp_1/cgroup.procs+ # cat /proc/7353/cgroup+ 0:cpuset,cpu,cpuacct,memory,devices,freezer,hugetlb:/sub_cgrp_1++(b) From the initial cgroup namespace, the real cgroup path will be visible:+ $ cat /proc/7353/cgroup+ 0:cpuset,cpu,cpuacct,memory,devices,freezer,hugetlb:/batchjobs/container_id1/sub_cgrp_1++(c) From a sibling cgroup namespace (that is, a namespace rooted at a+ different cgroup), the cgroup path relative to its own cgroup namespace+ root will be shown. For instance, if PID 7353's cgroup namespace root is+ at '/batchjobs/container_id2', then it will see++ # cat /proc/7353/cgroup+ 0:cpuset,cpu,cpuacct,memory,devices,freezer,hugetlb:/../container_id2/sub_cgrp_1++ Note that the relative path always starts with '/' to indicate that its+ relative to the cgroup namespace root of the caller.++(4) Processes inside a cgroup namespace can move into and out of the namespace+ root if they have proper access to external cgroups. So from inside a+ namespace with cgroupns root at /batchjobs/container_id1, and+ assuming that the global hierarchy is still accessible inside cgroupns:++ # cat /proc/7353/cgroup+ 0:cpuset,cpu,cpuacct,memory,devices,freezer,hugetlb:/sub_cgrp_1+ # echo 7353 > batchjobs/container_id2/cgroup.procs+ # cat /proc/7353/cgroup+ 0:cpuset,cpu,cpuacct,memory,devices,freezer,hugetlb:/../container_id2++ Note that this kind of setup is not encouraged. A task inside cgroup+ namespace should only be exposed to its own cgroupns hierarchy. Otherwise+ it makes the virtualization of "/proc/$PID/cgroup" less useful.++(5) Setns to another cgroup namespace is allowed when:+ (a) the process has CAP_SYS_ADMIN against its current user namespace+ (b) the process has CAP_SYS_ADMIN against the target cgroup namespace's+ userns+ No implicit cgroup changes happen with attaching to another cgroup+ namespace. It is expected that the somone moves the attaching process under+ the target cgroup namespace root.++(6) When some thread from a multi-threaded process unshares its+ cgroup namespace, the new cgroupns gets applied to the entire process (all+ the threads). For the unified hierarchy this is expected as it only allows+ process level containerization. For the legacy hierarchies this may be+ unexpected. So all the threads in the process will have the same cgroup.++(7) The cgroup namespace is alive as long as there is at least 1+ process inside it. When the last process exits, the cgroup+ namespace is destroyed. The cgroupns root and the actual cgroups+ remain.++(8) Namespace specific cgroup hierarchy can be mounted by a process running+ inside a non-init cgroup namespace:++ # mount -t cgroup -o __DEVEL__sane_behavior cgroup $MOUNT_POINT++ This will mount the unified cgroup hierarchy with cgroupns root as the+ filesystem root. The process needs CAP_SYS_ADMIN against its user and+ mounts namespaces.+ P. Information on Kernel Programming This section contains kernel programming information in the areas
From: Serge Hallyn <serge.hallyn-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
allowing root in a non-init user namespace to mount it. This should
now be safe, because
1. non-init-root cannot mount a previously unbound subsystem
2. the task doing the mount must be privileged with respect to the
user namespace owning the cgroup namespace
3. the mounted subsystem will have its current cgroup as the root dentry.
the permissions will be unchanged, so tasks will receive no new
privilege over the cgroups which they did not have on the original
mounts.
Signed-off-by: Serge Hallyn <redacted>
---
kernel/cgroup.c | 2 ++
1 file changed, 2 insertions(+)
From: Serge Hallyn <serge.hallyn-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
This patch enables cgroup mounting inside userns when a process
as appropriate privileges. The cgroup filesystem mounted is
rooted at the cgroupns-root. Thus, in a container-setup, only
the hierarchy under the cgroupns-root is exposed inside the container.
This allows container management tools to run inside the containers
without depending on any global state.
Signed-off-by: Serge Hallyn <redacted>
---
Changelog:
20151116 - Don't allow user namespaces to bind new subsystems
20151118 - postpone the FS_USERNS_MOUNT flag until the
last patch, until we can convince ourselves it
is safe.
20151207 - Switch to walking up the kernfs path from kn root.
- Group initialized variables
- Explain the capable(CAP_SYS_ADMIN) check
- Style fixes
---
kernel/cgroup.c | 40 +++++++++++++++++++++++++++++++++++++++-
1 file changed, 39 insertions(+), 1 deletion(-)
@@ -1991,6 +1992,14 @@ static struct dentry *cgroup_mount(struct file_system_type *fs_type,inti;boolnew_sb;+get_cgroup_ns(ns);++/* Check if the caller has permission to mount. */+if(!ns_capable(ns->user_ns,CAP_SYS_ADMIN)){+put_cgroup_ns(ns);+returnERR_PTR(-EPERM);+}+/**Thefirsttimeanyonetriestomountacgroup,enablethelist*linkingeachcss_settoitstasksandfixupallexistingtasks.
From: Aditya Kali <redacted>
Add a new kernfs api is added to lookup the dentry for a particular
kernfs path.
Signed-off-by: Aditya Kali <redacted>
Signed-off-by: Serge E. Hallyn <redacted>
---
Changelog:
20151116 - Don't allow user namespaces to bind new subsystems
20151118 - postpone the FS_USERNS_MOUNT flag until the
last patch, until we can convince ourselves it
is safe.
20151207 - Switch to walking up the kernfs path from kn root.
20151208 - Split out the kernfs change
- Style changes
- Switch from pr_crit to WARN_ON
- Reorder arguments to kernfs_obtain_root
- rename kernfs_obtain_root to kernfs_node_dentry
---
fs/kernfs/mount.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++
include/linux/kernfs.h | 2 ++
2 files changed, 69 insertions(+)
@@ -62,6 +63,72 @@ struct kernfs_root *kernfs_root_from_sb(struct super_block *sb)returnNULL;}+/*+*findthenextancestorinthepathdownto@child,where@parentwasthe+*ancestorwhosedescendantwewanttofind.+*+*Saythepathis/a/b/c/d.@childisd,@parentisNULL.Wereturntheroot+*node.If@parentisb,thenwereturnthenodeforc.+*Passingindas@parentisnotok.+*/+staticstructkernfs_node*+find_next_ancestor(structkernfs_node*child,structkernfs_node*parent)+{+if(child==parent){+pr_crit_once("BUG in find_next_ancestor: called with parent == child");+returnNULL;+}++while(child->parent!=parent){+if(!child->parent)+returnNULL;+child=child->parent;+}++returnchild;+}++/**+*kernfs_node_dentry-getadentryforthegivenkernfs_node+*@kn:kernfs_nodeforwhichadentryisneeded+*@sb:thekernfssuper_block+*/+structdentry*kernfs_node_dentry(structkernfs_node*kn,+structsuper_block*sb)+{+structdentry*dentry;+structkernfs_node*knparent=NULL;++BUG_ON(sb->s_op!=&kernfs_sops);++dentry=dget(sb->s_root);++/* Check if this is the root kernfs_node */+if(!kn->parent)+returndentry;++knparent=find_next_ancestor(kn,NULL);+if(WARN_ON(!knparent))+returnERR_PTR(-EINVAL);++do{+structdentry*dtmp;+structkernfs_node*kntmp;++if(kn==knparent)+returndentry;+kntmp=find_next_ancestor(kn,knparent);+if(WARN_ON(!kntmp))+returnERR_PTR(-EINVAL);+dtmp=lookup_one_len(kntmp->name,dentry,strlen(kntmp->name));+dput(dentry);+if(IS_ERR(dtmp))+returndtmp;+knparent=kntmp;+dentry=dtmp;+}while(1);+}+staticintkernfs_fill_super(structsuper_block*sb,unsignedlongmagic){structkernfs_super_info*info=kernfs_info(sb);
From: Aditya Kali <redacted>
Introduce the ability to create new cgroup namespace. The newly created
cgroup namespace remembers the cgroup of the process at the point
of creation of the cgroup namespace (referred as cgroupns-root).
The main purpose of cgroup namespace is to virtualize the contents
of /proc/self/cgroup file. Processes inside a cgroup namespace
are only able to see paths relative to their namespace root
(unless they are moved outside of their cgroupns-root, at which point
they will see a relative path from their cgroupns-root).
For a correctly setup container this enables container-tools
(like libcontainer, lxc, lmctfy, etc.) to create completely virtualized
containers without leaking system level cgroup hierarchy to the task.
This patch only implements the 'unshare' part of the cgroupns.
Signed-off-by: Aditya Kali <redacted>
Signed-off-by: Serge Hallyn <redacted>
---
Changelog: 2015-11-24
- move cgroup_namespace.c into cgroup.c (and .h)
- reformatting
- make get_cgroup_ns return void
- rename ns->root_cgrps to root_cset.
Changelog: 2015-12-08
- Move init_cgroup_ns to other variable declarations
- Remove accidental conversion of put-css_set to inline
- Drop BUG_ON(NULL)
- Remove unneeded pre declaration of struct cgroupns_operations.
- cgroup.h: collect common ns declerations
Changelog: 2015-12-09
- cgroup.h: move ns declarations to bottom
- cgroup.c: undo all accidental conversions to inline
Changelog: 2015-12-22
- update for new kernfs_path_from_node() return value. Since
cgroup_path was already gpl-exported, I abstained from updating
its return value.
---
fs/proc/namespaces.c | 3 +
include/linux/cgroup.h | 54 ++++++++++++++++--
include/linux/nsproxy.h | 2 +
include/linux/proc_ns.h | 4 ++
kernel/cgroup.c | 144 +++++++++++++++++++++++++++++++++++++++++++++++
kernel/fork.c | 2 +-
kernel/nsproxy.c | 21 ++++++-
7 files changed, 221 insertions(+), 9 deletions(-)
@@ -5272,6 +5304,8 @@ int __init cgroup_init(void)BUG_ON(cgroup_init_cftypes(NULL,cgroup_dfl_base_files));BUG_ON(cgroup_init_cftypes(NULL,cgroup_legacy_base_files));+get_user_ns(init_cgroup_ns.user_ns);+mutex_lock(&cgroup_mutex);/* Add init_css_set to the hash table */
@@ -5822,6 +5856,116 @@ struct cgroup *cgroup_get_from_path(const char *path)}EXPORT_SYMBOL_GPL(cgroup_get_from_path);+/* cgroup namespaces */++staticstructcgroup_namespace*alloc_cgroup_ns(void)+{+structcgroup_namespace*new_ns;+intret;++new_ns=kzalloc(sizeof(structcgroup_namespace),GFP_KERNEL);+if(!new_ns)+returnERR_PTR(-ENOMEM);+ret=ns_alloc_inum(&new_ns->ns);+if(ret){+kfree(new_ns);+returnERR_PTR(ret);+}+atomic_set(&new_ns->count,1);+new_ns->ns.ops=&cgroupns_operations;+returnnew_ns;+}++voidfree_cgroup_ns(structcgroup_namespace*ns)+{+put_css_set(ns->root_cset);+put_user_ns(ns->user_ns);+ns_free_inum(&ns->ns);+kfree(ns);+}+EXPORT_SYMBOL(free_cgroup_ns);++structcgroup_namespace*+copy_cgroup_ns(unsignedlongflags,structuser_namespace*user_ns,+structcgroup_namespace*old_ns)+{+structcgroup_namespace*new_ns=NULL;+structcss_set*cset=NULL;+interr;++BUG_ON(!old_ns);++if(!(flags&CLONE_NEWCGROUP)){+get_cgroup_ns(old_ns);+returnold_ns;+}++/* Allow only sysadmin to create cgroup namespace. */+err=-EPERM;+if(!ns_capable(user_ns,CAP_SYS_ADMIN))+gotoerr_out;++cset=task_css_set(current);+get_css_set(cset);++err=-ENOMEM;+new_ns=alloc_cgroup_ns();+if(!new_ns)+gotoerr_out;++new_ns->user_ns=get_user_ns(user_ns);+new_ns->root_cset=cset;++returnnew_ns;++err_out:+if(cset)+put_css_set(cset);+kfree(new_ns);+returnERR_PTR(err);+}++staticintcgroupns_install(structnsproxy*nsproxy,void*ns)+{+pr_info("setns not supported for cgroup namespace");+return-EINVAL;+}++staticstructns_common*cgroupns_get(structtask_struct*task)+{+structcgroup_namespace*ns=NULL;+structnsproxy*nsproxy;++task_lock(task);+nsproxy=task->nsproxy;+if(nsproxy){+ns=nsproxy->cgroup_ns;+get_cgroup_ns(ns);+}+task_unlock(task);++returnns?&ns->ns:NULL;+}++staticvoidcgroupns_put(structns_common*ns)+{+put_cgroup_ns(to_cg_ns(ns));+}++conststructproc_ns_operationscgroupns_operations={+.name="cgroup",+.type=CLONE_NEWCGROUP,+.get=cgroupns_get,+.put=cgroupns_put,+.install=cgroupns_install,+};++static__initintcgroup_namespaces_init(void)+{+return0;+}+subsys_initcall(cgroup_namespaces_init);+#ifdef CONFIG_CGROUP_DEBUGstaticstructcgroup_subsys_state*debug_css_alloc(structcgroup_subsys_state*parent_css)
@@ -1880,7 +1880,7 @@ static int check_unshare_flags(unsigned long unshare_flags)if(unshare_flags&~(CLONE_THREAD|CLONE_FS|CLONE_NEWNS|CLONE_SIGHAND|CLONE_VM|CLONE_FILES|CLONE_SYSVSEM|CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWNET|-CLONE_NEWUSER|CLONE_NEWPID))+CLONE_NEWUSER|CLONE_NEWPID|CLONE_NEWCGROUP))return-EINVAL;/**Notimplemented,butpretenditworksifthereisnothing
@@ -180,7 +197,7 @@ int unshare_nsproxy_namespaces(unsigned long unshare_flags,interr=0;if(!(unshare_flags&(CLONE_NEWNS|CLONE_NEWUTS|CLONE_NEWIPC|-CLONE_NEWNET|CLONE_NEWPID)))+CLONE_NEWNET|CLONE_NEWPID|CLONE_NEWCGROUP)))return0;user_ns=new_cred?new_cred->user_ns:current_user_ns();
From: Aditya Kali <redacted>
The new function kernfs_path_from_node() generates and returns kernfs
path of a given kernfs_node relative to a given parent kernfs_node.
Signed-off-by: Aditya Kali <redacted>
Signed-off-by: Serge E. Hallyn <redacted>
---
Changelog 20151125:
- Fully-wing multilinecomments
- Rework kernfs_path_from_node_locked() logic
- Replace BUG_ONs with returning NULL
- Use a const char* for /.. and precalculate its size
Changelog 20151130:
- Update kernfs_path_from_node_locked comment
Changelog 20151208:
- kernfs_node_distance:
* Remove BUG_ON(NULL)s
* Rename kernfs_node_distance to kernfs_depth
- kernfs_common-ancestor:
* Remove useless checks for depth == 0
* Add check to ensure nodes are from same root
- kernfs_path_from_node_locked:
* Remove needless __must_check
* Put p;len on its own decl line.
* Fix wrong WARN_ONCE usage
Changelog 20151209:
- kernfs_path_from_node: change arguments to 'to' and 'from', and
change their order.
Changelog 20151222:
- kernfs_path_from_node{,_locked}: return the string length.
kernfs_path is gpl-exported, so changing their return value seemed
ill-advised, but if noone minds I can update it too.
---
fs/kernfs/dir.c | 205 ++++++++++++++++++++++++++++++++++++++++--------
include/linux/kernfs.h | 9 ++-
2 files changed, 179 insertions(+), 35 deletions(-)
@@ -44,28 +44,123 @@ static int kernfs_name_locked(struct kernfs_node *kn, char *buf, size_t buflen)returnstrlcpy(buf,kn->parent?kn->name:"/",buflen);}-staticchar*__must_checkkernfs_path_locked(structkernfs_node*kn,char*buf,-size_tbuflen)+/* kernfs_node_depth - compute depth from @from to @to */+staticsize_tkernfs_depth(structkernfs_node*from,structkernfs_node*to){-char*p=buf+buflen;-intlen;+size_tdepth=0;-*--p='\0';+while(to->parent&&to!=from){+depth++;+to=to->parent;+}+returndepth;+}-do{-len=strlen(kn->name);-if(p-buf<len+1){-buf[0]='\0';-p=NULL;-break;-}-p-=len;-memcpy(p,kn->name,len);-*--p='/';-kn=kn->parent;-}while(kn&&kn->parent);+staticstructkernfs_node*kernfs_common_ancestor(structkernfs_node*a,+structkernfs_node*b)+{+size_tda,db;+structkernfs_root*ra=kernfs_root(a),*rb=kernfs_root(b);++if(ra!=rb)+returnNULL;++da=kernfs_depth(ra->kn,a);+db=kernfs_depth(rb->kn,b);++while(da>db){+a=a->parent;+da--;+}+while(db>da){+b=b->parent;+db--;+}++/* worst case b and a will be the same at root */+while(b!=a){+b=b->parent;+a=a->parent;+}++returna;+}++/**+*kernfs_path_from_node_locked-findapseudo-absolutepathto@kn_to,+*wherekn_fromistreatedasrootofthepath.+*@kn_from:kernfsnodewhichshouldbetreatedasrootforthepath+*@kn_to:kernfsnodetowhichpathisneeded+*@buf:buffertocopythepathinto+*@buflen:sizeof@buf+*+*Weneedtohandlecoupleofscenarioshere:+*[1]when@kn_fromisanancestorof@kn_toatsomelevel+*kn_from:/n1/n2/n3+*kn_to:/n1/n2/n3/n4/n5+*result:/n4/n5+*+*[2]when@kn_fromisonadifferenthierarchyandweneedtofindcommon+*ancestorbetween@kn_fromand@kn_to.+*kn_from:/n1/n2/n3/n4+*kn_to:/n1/n2/n5+*result:/../../n5+*OR+*kn_from:/n1/n2/n3/n4/n5[depth=5]+*kn_to:/n1/n2/n3[depth=3]+*result:/../..+*+*returnvalue:lengthofthestring.Ifgreaterthanbuflen,+*thencontentsofbufareundefined.Onerror,-1isreturned.+*/+staticint+kernfs_path_from_node_locked(structkernfs_node*kn_to,+structkernfs_node*kn_from,char*buf,+size_tbuflen)+{+structkernfs_node*kn,*common;+constcharparent_str[]="/..";+size_tdepth_from,depth_to,len=0,nlen=0;+char*p;+inti;++if(!kn_from)+kn_from=kernfs_root(kn_to)->kn;++if(kn_from==kn_to)+returnstrlcpy(buf,"/",buflen);++common=kernfs_common_ancestor(kn_from,kn_to);+if(WARN_ON(!common))+return-1;++depth_to=kernfs_depth(common,kn_to);+depth_from=kernfs_depth(common,kn_from);++if(buf)+buf[0]='\0';++for(i=0;i<depth_from;i++)+len+=strlcpy(buf+len,parent_str,+len<buflen?buflen-len:0);++/* Calculate how many bytes we need for the rest */+for(kn=kn_to;kn!=common;kn=kn->parent)+nlen+=strlen(kn->name)+1;-returnp;+if(len+nlen>=buflen)+returnlen+nlen;++p=buf+len+nlen;+*p='\0';+for(kn=kn_to;kn!=common;kn=kn->parent){+nlen=strlen(kn->name);+p-=nlen;+memcpy(p,kn->name,nlen);+*(--p)='/';+}++returnlen+nlen;}/**
Hello, Serge.
On Tue, Dec 22, 2015 at 10:23:22PM -0600, serge.hallyn-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org wrote:
quoted hunk
@@ -164,18 +286,39 @@ void pr_cont_kernfs_name(struct kernfs_node *kn) void pr_cont_kernfs_path(struct kernfs_node *kn) { unsigned long flags;- char *p;+ char *p = NULL;+ int sz1, sz2; spin_lock_irqsave(&kernfs_rename_lock, flags);- p = kernfs_path_locked(kn, kernfs_pr_cont_buf,- sizeof(kernfs_pr_cont_buf));- if (p)- pr_cont("%s", p);- else- pr_cont("<name too long>");+ sz1 = kernfs_path_from_node_locked(kn, NULL, kernfs_pr_cont_buf,+ sizeof(kernfs_pr_cont_buf));+ if (sz1 < 0) {+ pr_cont("(error)");+ goto out;+ }++ if (sz1 < sizeof(kernfs_pr_cont_buf)) {+ pr_cont("%s", kernfs_pr_cont_buf);+ goto out;+ }++ p = kmalloc(sz1 + 1, GFP_NOFS);
We can't do GFP_NOFS allocation while holding a spinlock and we don't
want to do atomic allocation here either. I think it'd be best to
keep using the static buffer.
Thanks.
--
tejun
Hello,
On Tue, Dec 22, 2015 at 10:23:24PM -0600, serge.hallyn-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org wrote:
...
+char *cgroup_path(struct cgroup *cgrp, char *buf, size_t buflen)
+{
+ int ret;
+
+ ret = cgroup_path_ns(cgrp, buf, buflen, current->nsproxy->cgroup_ns);
+ if (ret < 0 || ret >= buflen)
+ return NULL;
+ return buf;
+}
+EXPORT_SYMBOL_GPL(cgroup_path);
Shouldn't this function check whether it's being called from a task
context? e.g. it could be being called from an irq handler and may
end up scoping the path incorrectly.
Thanks.
--
tejun
On Tue, Dec 22, 2015 at 10:23:22PM -0600, serge.hallyn-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org wrote:
From: Aditya Kali <redacted>
The new function kernfs_path_from_node() generates and returns kernfs
path of a given kernfs_node relative to a given parent kernfs_node.
Signed-off-by: Aditya Kali <redacted>
Signed-off-by: Serge E. Hallyn <redacted>
Greg, can I route this together with other changes?
Thanks.
--
tejun
On Tue, Dec 22, 2015 at 10:23:26PM -0600, serge.hallyn-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org wrote:
From: Aditya Kali <redacted>
Add a new kernfs api is added to lookup the dentry for a particular
kernfs path.
Signed-off-by: Aditya Kali <redacted>
Signed-off-by: Serge E. Hallyn <redacted>
Greg, this is the other kernfs change in the series. Can I route this
through the cgroup tree with other changes?
Thanks.
--
tejun
From: Serge E. Hallyn <hidden> Date: 2015-12-23 16:36:34
On Wed, Dec 23, 2015 at 11:08:54AM -0500, Tejun Heo wrote:
Hello, Serge.
On Tue, Dec 22, 2015 at 10:23:22PM -0600, serge.hallyn-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org wrote:
quoted
@@ -164,18 +286,39 @@ void pr_cont_kernfs_name(struct kernfs_node *kn) void pr_cont_kernfs_path(struct kernfs_node *kn) { unsigned long flags;- char *p;+ char *p = NULL;+ int sz1, sz2; spin_lock_irqsave(&kernfs_rename_lock, flags);- p = kernfs_path_locked(kn, kernfs_pr_cont_buf,- sizeof(kernfs_pr_cont_buf));- if (p)- pr_cont("%s", p);- else- pr_cont("<name too long>");+ sz1 = kernfs_path_from_node_locked(kn, NULL, kernfs_pr_cont_buf,+ sizeof(kernfs_pr_cont_buf));+ if (sz1 < 0) {+ pr_cont("(error)");+ goto out;+ }++ if (sz1 < sizeof(kernfs_pr_cont_buf)) {+ pr_cont("%s", kernfs_pr_cont_buf);+ goto out;+ }++ p = kmalloc(sz1 + 1, GFP_NOFS);
We can't do GFP_NOFS allocation while holding a spinlock and we don't
want to do atomic allocation here either. I think it'd be best to
keep using the static buffer.
On Wed, Dec 23, 2015 at 11:25:15AM -0500, Tejun Heo wrote:
On Tue, Dec 22, 2015 at 10:23:26PM -0600, serge.hallyn-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org wrote:
quoted
From: Aditya Kali <redacted>
Add a new kernfs api is added to lookup the dentry for a particular
kernfs path.
Signed-off-by: Aditya Kali <redacted>
Signed-off-by: Serge E. Hallyn <redacted>
Greg, this is the other kernfs change in the series. Can I route this
through the cgroup tree with other changes?
On Wed, Dec 23, 2015 at 11:24:33AM -0500, Tejun Heo wrote:
On Tue, Dec 22, 2015 at 10:23:22PM -0600, serge.hallyn-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org wrote:
quoted
From: Aditya Kali <redacted>
The new function kernfs_path_from_node() generates and returns kernfs
path of a given kernfs_node relative to a given parent kernfs_node.
Signed-off-by: Aditya Kali <redacted>
Signed-off-by: Serge E. Hallyn <redacted>
Greg, can I route this together with other changes?
From: Serge E. Hallyn <hidden> Date: 2015-12-23 19:33:33
The new function kernfs_path_from_node() generates and returns kernfs
path of a given kernfs_node relative to a given parent kernfs_node.
Signed-off-by: Aditya Kali <redacted>
Signed-off-by: Serge E. Hallyn <redacted>
Acked-by: Greg Kroah-Hartman <redacted>
---
Changelog 20151125:
- Fully-wing multilinecomments
- Rework kernfs_path_from_node_locked() logic
- Replace BUG_ONs with returning NULL
- Use a const char* for /.. and precalculate its size
Changelog 20151130:
- Update kernfs_path_from_node_locked comment
Changelog 20151208:
- kernfs_node_distance:
* Remove BUG_ON(NULL)s
* Rename kernfs_node_distance to kernfs_depth
- kernfs_common-ancestor:
* Remove useless checks for depth == 0
* Add check to ensure nodes are from same root
- kernfs_path_from_node_locked:
* Remove needless __must_check
* Put p;len on its own decl line.
* Fix wrong WARN_ONCE usage
Changelog 20151209:
- kernfs_path_from_node: change arguments to 'to' and 'from', and
change their order.
Changelog 20151222:
- kernfs_path_from_node{,_locked}: return the string length.
kernfs_path is gpl-exported, so changing their return value seemed
ill-advised, but if noone minds I can update it too.
Changelog 20151223:
- don't allocate memory pr_cont_kernfs_path() under spinlock
---
fs/kernfs/dir.c | 192 ++++++++++++++++++++++++++++++++++++++++--------
include/linux/kernfs.h | 9 ++-
2 files changed, 166 insertions(+), 35 deletions(-)
@@ -44,28 +44,123 @@ static int kernfs_name_locked(struct kernfs_node *kn, char *buf, size_t buflen)returnstrlcpy(buf,kn->parent?kn->name:"/",buflen);}-staticchar*__must_checkkernfs_path_locked(structkernfs_node*kn,char*buf,-size_tbuflen)+/* kernfs_node_depth - compute depth from @from to @to */+staticsize_tkernfs_depth(structkernfs_node*from,structkernfs_node*to){-char*p=buf+buflen;-intlen;+size_tdepth=0;-*--p='\0';+while(to->parent&&to!=from){+depth++;+to=to->parent;+}+returndepth;+}-do{-len=strlen(kn->name);-if(p-buf<len+1){-buf[0]='\0';-p=NULL;-break;-}-p-=len;-memcpy(p,kn->name,len);-*--p='/';-kn=kn->parent;-}while(kn&&kn->parent);+staticstructkernfs_node*kernfs_common_ancestor(structkernfs_node*a,+structkernfs_node*b)+{+size_tda,db;+structkernfs_root*ra=kernfs_root(a),*rb=kernfs_root(b);++if(ra!=rb)+returnNULL;++da=kernfs_depth(ra->kn,a);+db=kernfs_depth(rb->kn,b);++while(da>db){+a=a->parent;+da--;+}+while(db>da){+b=b->parent;+db--;+}++/* worst case b and a will be the same at root */+while(b!=a){+b=b->parent;+a=a->parent;+}++returna;+}++/**+*kernfs_path_from_node_locked-findapseudo-absolutepathto@kn_to,+*wherekn_fromistreatedasrootofthepath.+*@kn_from:kernfsnodewhichshouldbetreatedasrootforthepath+*@kn_to:kernfsnodetowhichpathisneeded+*@buf:buffertocopythepathinto+*@buflen:sizeof@buf+*+*Weneedtohandlecoupleofscenarioshere:+*[1]when@kn_fromisanancestorof@kn_toatsomelevel+*kn_from:/n1/n2/n3+*kn_to:/n1/n2/n3/n4/n5+*result:/n4/n5+*+*[2]when@kn_fromisonadifferenthierarchyandweneedtofindcommon+*ancestorbetween@kn_fromand@kn_to.+*kn_from:/n1/n2/n3/n4+*kn_to:/n1/n2/n5+*result:/../../n5+*OR+*kn_from:/n1/n2/n3/n4/n5[depth=5]+*kn_to:/n1/n2/n3[depth=3]+*result:/../..+*+*returnvalue:lengthofthestring.Ifgreaterthanbuflen,+*thencontentsofbufareundefined.Onerror,-1isreturned.+*/+staticint+kernfs_path_from_node_locked(structkernfs_node*kn_to,+structkernfs_node*kn_from,char*buf,+size_tbuflen)+{+structkernfs_node*kn,*common;+constcharparent_str[]="/..";+size_tdepth_from,depth_to,len=0,nlen=0;+char*p;+inti;++if(!kn_from)+kn_from=kernfs_root(kn_to)->kn;++if(kn_from==kn_to)+returnstrlcpy(buf,"/",buflen);++common=kernfs_common_ancestor(kn_from,kn_to);+if(WARN_ON(!common))+return-1;++depth_to=kernfs_depth(common,kn_to);+depth_from=kernfs_depth(common,kn_from);++if(buf)+buf[0]='\0';-returnp;+for(i=0;i<depth_from;i++)+len+=strlcpy(buf+len,parent_str,+len<buflen?buflen-len:0);++/* Calculate how many bytes we need for the rest */+for(kn=kn_to;kn!=common;kn=kn->parent)+nlen+=strlen(kn->name)+1;++if(len+nlen>=buflen)+returnlen+nlen;++p=buf+len+nlen;+*p='\0';+for(kn=kn_to;kn!=common;kn=kn->parent){+nlen=strlen(kn->name);+p-=nlen;+memcpy(p,kn->name,nlen);+*(--p)='/';+}++returnlen+nlen;}/**
From: Serge E. Hallyn <hidden> Date: 2015-12-23 19:34:48
Introduce the ability to create new cgroup namespace. The newly created
cgroup namespace remembers the cgroup of the process at the point
of creation of the cgroup namespace (referred as cgroupns-root).
The main purpose of cgroup namespace is to virtualize the contents
of /proc/self/cgroup file. Processes inside a cgroup namespace
are only able to see paths relative to their namespace root
(unless they are moved outside of their cgroupns-root, at which point
they will see a relative path from their cgroupns-root).
For a correctly setup container this enables container-tools
(like libcontainer, lxc, lmctfy, etc.) to create completely virtualized
containers without leaking system level cgroup hierarchy to the task.
This patch only implements the 'unshare' part of the cgroupns.
Signed-off-by: Aditya Kali <redacted>
Signed-off-by: Serge Hallyn <redacted>
---
Changelog: 2015-11-24
- move cgroup_namespace.c into cgroup.c (and .h)
- reformatting
- make get_cgroup_ns return void
- rename ns->root_cgrps to root_cset.
Changelog: 2015-12-08
- Move init_cgroup_ns to other variable declarations
- Remove accidental conversion of put-css_set to inline
- Drop BUG_ON(NULL)
- Remove unneeded pre declaration of struct cgroupns_operations.
- cgroup.h: collect common ns declerations
Changelog: 2015-12-09
- cgroup.h: move ns declarations to bottom
- cgroup.c: undo all accidental conversions to inline
Changelog: 2015-12-22
- update for new kernfs_path_from_node() return value. Since
cgroup_path was already gpl-exported, I abstained from updating
its return value.
Changelog: 2015-12-23
- cgroup_path(): use init_cgroup_ns when in interupt context.
---
fs/proc/namespaces.c | 3 +
include/linux/cgroup.h | 54 +++++++++++++++--
include/linux/nsproxy.h | 2 +
include/linux/proc_ns.h | 4 ++
kernel/cgroup.c | 148 +++++++++++++++++++++++++++++++++++++++++++++++
kernel/fork.c | 2 +-
kernel/nsproxy.c | 21 ++++++-
7 files changed, 225 insertions(+), 9 deletions(-)
@@ -5272,6 +5308,8 @@ int __init cgroup_init(void)BUG_ON(cgroup_init_cftypes(NULL,cgroup_dfl_base_files));BUG_ON(cgroup_init_cftypes(NULL,cgroup_legacy_base_files));+get_user_ns(init_cgroup_ns.user_ns);+mutex_lock(&cgroup_mutex);/* Add init_css_set to the hash table */
@@ -5822,6 +5860,116 @@ struct cgroup *cgroup_get_from_path(const char *path)}EXPORT_SYMBOL_GPL(cgroup_get_from_path);+/* cgroup namespaces */++staticstructcgroup_namespace*alloc_cgroup_ns(void)+{+structcgroup_namespace*new_ns;+intret;++new_ns=kzalloc(sizeof(structcgroup_namespace),GFP_KERNEL);+if(!new_ns)+returnERR_PTR(-ENOMEM);+ret=ns_alloc_inum(&new_ns->ns);+if(ret){+kfree(new_ns);+returnERR_PTR(ret);+}+atomic_set(&new_ns->count,1);+new_ns->ns.ops=&cgroupns_operations;+returnnew_ns;+}++voidfree_cgroup_ns(structcgroup_namespace*ns)+{+put_css_set(ns->root_cset);+put_user_ns(ns->user_ns);+ns_free_inum(&ns->ns);+kfree(ns);+}+EXPORT_SYMBOL(free_cgroup_ns);++structcgroup_namespace*+copy_cgroup_ns(unsignedlongflags,structuser_namespace*user_ns,+structcgroup_namespace*old_ns)+{+structcgroup_namespace*new_ns=NULL;+structcss_set*cset=NULL;+interr;++BUG_ON(!old_ns);++if(!(flags&CLONE_NEWCGROUP)){+get_cgroup_ns(old_ns);+returnold_ns;+}++/* Allow only sysadmin to create cgroup namespace. */+err=-EPERM;+if(!ns_capable(user_ns,CAP_SYS_ADMIN))+gotoerr_out;++cset=task_css_set(current);+get_css_set(cset);++err=-ENOMEM;+new_ns=alloc_cgroup_ns();+if(!new_ns)+gotoerr_out;++new_ns->user_ns=get_user_ns(user_ns);+new_ns->root_cset=cset;++returnnew_ns;++err_out:+if(cset)+put_css_set(cset);+kfree(new_ns);+returnERR_PTR(err);+}++staticintcgroupns_install(structnsproxy*nsproxy,void*ns)+{+pr_info("setns not supported for cgroup namespace");+return-EINVAL;+}++staticstructns_common*cgroupns_get(structtask_struct*task)+{+structcgroup_namespace*ns=NULL;+structnsproxy*nsproxy;++task_lock(task);+nsproxy=task->nsproxy;+if(nsproxy){+ns=nsproxy->cgroup_ns;+get_cgroup_ns(ns);+}+task_unlock(task);++returnns?&ns->ns:NULL;+}++staticvoidcgroupns_put(structns_common*ns)+{+put_cgroup_ns(to_cg_ns(ns));+}++conststructproc_ns_operationscgroupns_operations={+.name="cgroup",+.type=CLONE_NEWCGROUP,+.get=cgroupns_get,+.put=cgroupns_put,+.install=cgroupns_install,+};++static__initintcgroup_namespaces_init(void)+{+return0;+}+subsys_initcall(cgroup_namespaces_init);+#ifdef CONFIG_CGROUP_DEBUGstaticstructcgroup_subsys_state*debug_css_alloc(structcgroup_subsys_state*parent_css)
@@ -1880,7 +1880,7 @@ static int check_unshare_flags(unsigned long unshare_flags)if(unshare_flags&~(CLONE_THREAD|CLONE_FS|CLONE_NEWNS|CLONE_SIGHAND|CLONE_VM|CLONE_FILES|CLONE_SYSVSEM|CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWNET|-CLONE_NEWUSER|CLONE_NEWPID))+CLONE_NEWUSER|CLONE_NEWPID|CLONE_NEWCGROUP))return-EINVAL;/**Notimplemented,butpretenditworksifthereisnothing
@@ -180,7 +197,7 @@ int unshare_nsproxy_namespaces(unsigned long unshare_flags,interr=0;if(!(unshare_flags&(CLONE_NEWNS|CLONE_NEWUTS|CLONE_NEWIPC|-CLONE_NEWNET|CLONE_NEWPID)))+CLONE_NEWNET|CLONE_NEWPID|CLONE_NEWCGROUP)))return0;user_ns=new_cred?new_cred->user_ns:current_user_ns();
Hello,
I did some heavy editing of the documentation. How does this look?
Did I miss anything?
Thanks.
---
Documentation/cgroup.txt | 146 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 146 insertions(+)
@@ -47,6 +47,11 @@ CONTENTS 5-3. IO 5-3-1. IO Interface Files 5-3-2. Writeback+6. Namespace+ 6-1. Basics+ 6-2. The Root and Views+ 6-3. Migration and setns(2)+ 6-4. Interaction with Other Namespaces P. Information on Kernel Programming P-1. Filesystem Support for Writeback D. Deprecated v1 Core Features
@@ -1013,6 +1018,147 @@ writeback as follows. vm.dirty[_background]_ratio.+6. Namespace++6-1. Basics++cgroup namespace provides a mechanism to virtualize the view of the+"/proc/$PID/cgroup" file. The CLONE_NEWCGROUP clone flag can be used+with clone(2) and unshare(2) to create a new cgroup namespace. The+process running inside the cgroup namespace will have its+"/proc/$PID/cgroup" output restricted to cgroupns root. The cgroupns+root is the cgroup of the process at the time of creation of the+cgroup namespace.++Without cgroup namespace, the "/proc/$PID/cgroup" file shows the+complete path of the cgroup of a process. In a container setup where+a set of cgroups and namespaces are intended to isolate processes the+"/proc/$PID/cgroup" file may leak potential system level information+to the isolated processes. For Example:++ # cat /proc/self/cgroup+ 0::/batchjobs/container_id1++The path '/batchjobs/container_id1' can be considered as system-data+and undesirable to expose to the isolated processes. cgroup namespace+can be used to restrict visibility of this path. For example, before+creating a cgroup namespace, one would see:++ # ls -l /proc/self/ns/cgroup+ lrwxrwxrwx 1 root root 0 2014-07-15 10:37 /proc/self/ns/cgroup -> cgroup:[4026531835]+ # cat /proc/self/cgroup+ 0::/batchjobs/container_id1++After unsharing a new namespace, the view changes.++ # ls -l /proc/self/ns/cgroup+ lrwxrwxrwx 1 root root 0 2014-07-15 10:35 /proc/self/ns/cgroup -> cgroup:[4026532183]+ # cat /proc/self/cgroup+ 0::/++When some thread from a multi-threaded process unshares its cgroup+namespace, the new cgroupns gets applied to the entire process (all+the threads). This is natural for the v2 hierarchy; however, for the+legacy hierarchies, this may be unexpected.++A cgroup namespace is alive as long as there are processes inside it.+When the last process exits, the cgroup namespace is destroyed. The+cgroupns root and the actual cgroups remain.+++6-2. The Root and Views++The 'cgroupns root' for a cgroup namespace is the cgroup in which the+process calling unshare(2) is running. For example, if a process in+/batchjobs/container_id1 cgroup calls unshare, cgroup+/batchjobs/container_id1 becomes the cgroupns root. For the+init_cgroup_ns, this is the real root ('/') cgroup.++The cgroupns root cgroup does not change even if the namespace creator+process later moves to a different cgroup.++ # ~/unshare -c # unshare cgroupns in some cgroup+ # cat /proc/self/cgroup+ 0::/+ # mkdir sub_cgrp_1+ # echo 0 > sub_cgrp_1/cgroup.procs+ # cat /proc/self/cgroup+ 0::/sub_cgrp_1++Each process gets its namespace-specific view of "/proc/$PID/cgroup"++Processes running inside the cgroup namespace will be able to see+cgroup paths (in /proc/self/cgroup) only inside their root cgroup.+From within an unshared cgroupns:++ # sleep 100000 &+ [1] 7353+ # echo 7353 > sub_cgrp_1/cgroup.procs+ # cat /proc/7353/cgroup+ 0::/sub_cgrp_1++From the initial cgroup namespace, the real cgroup path will be+visible:++ $ cat /proc/7353/cgroup+ 0::/batchjobs/container_id1/sub_cgrp_1++From a sibling cgroup namespace (that is, a namespace rooted at a+different cgroup), the cgroup path relative to its own cgroup+namespace root will be shown. For instance, if PID 7353's cgroup+namespace root is at '/batchjobs/container_id2', then it will see++ # cat /proc/7353/cgroup+ 0::/../container_id2/sub_cgrp_1++Note that the relative path always starts with '/' to indicate that+its relative to the cgroup namespace root of the caller.+++6-3. Migration and setns(2)++Processes inside a cgroup namespace can move into and out of the+namespace root if they have proper access to external cgroups. For+example, from inside a namespace with cgroupns root at+/batchjobs/container_id1, and assuming that the global hierarchy is+still accessible inside cgroupns:++ # cat /proc/7353/cgroup+ 0::/sub_cgrp_1+ # echo 7353 > batchjobs/container_id2/cgroup.procs+ # cat /proc/7353/cgroup+ 0::/../container_id2++Note that this kind of setup is not encouraged. A task inside cgroup+namespace should only be exposed to its own cgroupns hierarchy.++setns(2) to another cgroup namespace is allowed when:++(a) the process has CAP_SYS_ADMIN against its current user namespace+(b) the process has CAP_SYS_ADMIN against the target cgroup+ namespace's userns++No implicit cgroup changes happen with attaching to another cgroup+namespace. It is expected that the someone moves the attaching+process under the target cgroup namespace root.+++6-4. Interaction with Other Namespaces++Namespace specific cgroup hierarchy can be mounted by a process+running inside a non-init cgroup namespace.++ # mount -t cgroup2 none $MOUNT_POINT++This will mount the unified cgroup hierarchy with cgroupns root as the+filesystem root. The process needs CAP_SYS_ADMIN against its user and+mount namespaces.++The virtualization of /proc/self/cgroup file combined with restricting+the view of cgroup hierarchy by namespace-private cgroupfs mount+provides a properly isolated cgroup view inside the container.++ P. Information on Kernel Programming This section contains kernel programming information in the areas
@@ -47,6 +47,11 @@ CONTENTS 5-3. IO 5-3-1. IO Interface Files 5-3-2. Writeback+6. Namespace+ 6-1. Basics+ 6-2. The Root and Views+ 6-3. Migration and setns(2)+ 6-4. Interaction with Other Namespaces
P. Information on Kernel Programming
P-1. Filesystem Support for Writeback
D. Deprecated v1 Core Features
@@ -1013,6 +1018,147 @@ writeback as follows.
vm.dirty[_background]_ratio.
+6. Namespace
+
+6-1. Basics
+
+cgroup namespace provides a mechanism to virtualize the view of the
+"/proc/$PID/cgroup" file
and cgroup mounts
. The CLONE_NEWCGROUP clone flag can be used
+with clone(2) and unshare(2) to create a new cgroup namespace. The
+process running inside the cgroup namespace will have its
+"/proc/$PID/cgroup" output restricted to cgroupns root. The cgroupns
+root is the cgroup of the process at the time of creation of the
+cgroup namespace.
+
+Without cgroup namespace, the "/proc/$PID/cgroup" file shows the
+complete path of the cgroup of a process. In a container setup where
+a set of cgroups and namespaces are intended to isolate processes the
+"/proc/$PID/cgroup" file may leak potential system level information
+to the isolated processes. For Example:
+
+ # cat /proc/self/cgroup
+ 0::/batchjobs/container_id1
+
+The path '/batchjobs/container_id1' can be considered as system-data
+and undesirable to expose to the isolated processes. cgroup namespace
+can be used to restrict visibility of this path. For example, before
+creating a cgroup namespace, one would see:
+
+ # ls -l /proc/self/ns/cgroup
+ lrwxrwxrwx 1 root root 0 2014-07-15 10:37 /proc/self/ns/cgroup ->
cgroup:[4026531835] + # cat /proc/self/cgroup
+ 0::/batchjobs/container_id1
+
+After unsharing a new namespace, the view changes.
+
+ # ls -l /proc/self/ns/cgroup
+ lrwxrwxrwx 1 root root 0 2014-07-15 10:35 /proc/self/ns/cgroup ->
cgroup:[4026532183] + # cat /proc/self/cgroup
+ 0::/
+
+When some thread from a multi-threaded process unshares its cgroup
+namespace, the new cgroupns gets applied to the entire process (all
+the threads). This is natural for the v2 hierarchy; however, for the
+legacy hierarchies, this may be unexpected.
+
+A cgroup namespace is alive as long as there are processes inside it.
Or mounts pinning it.
+When the last process exits
or the last mount is umounted,
, the cgroup namespace is destroyed. The
+cgroupns root and the actual cgroups remain.
+
+
+6-2. The Root and Views
+
+The 'cgroupns root' for a cgroup namespace is the cgroup in which the
+process calling unshare(2) is running. For example, if a process in
+/batchjobs/container_id1 cgroup calls unshare, cgroup
+/batchjobs/container_id1 becomes the cgroupns root. For the
+init_cgroup_ns, this is the real root ('/') cgroup.
+
+The cgroupns root cgroup does not change even if the namespace creator
+process later moves to a different cgroup.
+
+ # ~/unshare -c # unshare cgroupns in some cgroup
+ # cat /proc/self/cgroup
+ 0::/
+ # mkdir sub_cgrp_1
+ # echo 0 > sub_cgrp_1/cgroup.procs
+ # cat /proc/self/cgroup
+ 0::/sub_cgrp_1
+
+Each process gets its namespace-specific view of "/proc/$PID/cgroup"
+
+Processes running inside the cgroup namespace will be able to see
+cgroup paths (in /proc/self/cgroup) only inside their root cgroup.
+From within an unshared cgroupns:
+
+ # sleep 100000 &
+ [1] 7353
+ # echo 7353 > sub_cgrp_1/cgroup.procs
+ # cat /proc/7353/cgroup
+ 0::/sub_cgrp_1
+
+From the initial cgroup namespace, the real cgroup path will be
+visible:
+
+ $ cat /proc/7353/cgroup
+ 0::/batchjobs/container_id1/sub_cgrp_1
+
+From a sibling cgroup namespace (that is, a namespace rooted at a
+different cgroup), the cgroup path relative to its own cgroup
+namespace root will be shown. For instance, if PID 7353's cgroup
+namespace root is at '/batchjobs/container_id2', then it will see
+
+ # cat /proc/7353/cgroup
+ 0::/../container_id2/sub_cgrp_1
+
+Note that the relative path always starts with '/' to indicate that
+its relative to the cgroup namespace root of the caller.
+
+
+6-3. Migration and setns(2)
+
+Processes inside a cgroup namespace can move into and out of the
+namespace root if they have proper access to external cgroups
this really means two things - write DAC access to the cgroupfs files, and access to the directories through a cgroupfs mount. Not sure if that should be spelled out.
. For
+example, from inside a namespace with cgroupns root at
+/batchjobs/container_id1, and assuming that the global hierarchy is
+still accessible inside cgroupns:
+
+ # cat /proc/7353/cgroup
+ 0::/sub_cgrp_1
+ # echo 7353 > batchjobs/container_id2/cgroup.procs
+ # cat /proc/7353/cgroup
+ 0::/../container_id2
+
+Note that this kind of setup is not encouraged. A task inside cgroup
+namespace should only be exposed to its own cgroupns hierarchy.
+
+setns(2) to another cgroup namespace is allowed when:
+
+(a) the process has CAP_SYS_ADMIN against its current user namespace
+(b) the process has CAP_SYS_ADMIN against the target cgroup
+ namespace's userns
+
+No implicit cgroup changes happen with attaching to another cgroup
+namespace. It is expected that the someone moves the attaching
+process under the target cgroup namespace root.
+
+
+6-4. Interaction with Other Namespaces
+
+Namespace specific cgroup hierarchy can be mounted by a process
+running inside a non-init cgroup namespace.
+
+ # mount -t cgroup2 none $MOUNT_POINT
+
+This will mount the unified cgroup hierarchy with cgroupns root as the
+filesystem root. The process needs CAP_SYS_ADMIN against its user and
+mount namespaces.
+
+The virtualization of /proc/self/cgroup file combined with restricting
+the view of cgroup hierarchy by namespace-private cgroupfs mount
+provides a properly isolated cgroup view inside the container.
+
+
P. Information on Kernel Programming
This section contains kernel programming information in the areas
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel"
in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
@@ -47,6 +47,11 @@ CONTENTS 5-3. IO 5-3-1. IO Interface Files 5-3-2. Writeback+6. Namespace+ 6-1. Basics+ 6-2. The Root and Views+ 6-3. Migration and setns(2)+ 6-4. Interaction with Other Namespaces P. Information on Kernel Programming P-1. Filesystem Support for Writeback D. Deprecated v1 Core Features
@@ -1013,6 +1018,148 @@ writeback as follows. vm.dirty[_background]_ratio.+6. Namespace++6-1. Basics++cgroup namespace provides a mechanism to virtualize the view of the+"/proc/$PID/cgroup" file and cgroup mounts. The CLONE_NEWCGROUP clone+flag can be used with clone(2) and unshare(2) to create a new cgroup+namespace. The process running inside the cgroup namespace will have+its "/proc/$PID/cgroup" output restricted to cgroupns root. The+cgroupns root is the cgroup of the process at the time of creation of+the cgroup namespace.++Without cgroup namespace, the "/proc/$PID/cgroup" file shows the+complete path of the cgroup of a process. In a container setup where+a set of cgroups and namespaces are intended to isolate processes the+"/proc/$PID/cgroup" file may leak potential system level information+to the isolated processes. For Example:++ # cat /proc/self/cgroup+ 0::/batchjobs/container_id1++The path '/batchjobs/container_id1' can be considered as system-data+and undesirable to expose to the isolated processes. cgroup namespace+can be used to restrict visibility of this path. For example, before+creating a cgroup namespace, one would see:++ # ls -l /proc/self/ns/cgroup+ lrwxrwxrwx 1 root root 0 2014-07-15 10:37 /proc/self/ns/cgroup -> cgroup:[4026531835]+ # cat /proc/self/cgroup+ 0::/batchjobs/container_id1++After unsharing a new namespace, the view changes.++ # ls -l /proc/self/ns/cgroup+ lrwxrwxrwx 1 root root 0 2014-07-15 10:35 /proc/self/ns/cgroup -> cgroup:[4026532183]+ # cat /proc/self/cgroup+ 0::/++When some thread from a multi-threaded process unshares its cgroup+namespace, the new cgroupns gets applied to the entire process (all+the threads). This is natural for the v2 hierarchy; however, for the+legacy hierarchies, this may be unexpected.++A cgroup namespace is alive as long as there are processes inside or+mounts pinning it. When the last usage goes away, the cgroup+namespace is destroyed. The cgroupns root and the actual cgroups+remain.+++6-2. The Root and Views++The 'cgroupns root' for a cgroup namespace is the cgroup in which the+process calling unshare(2) is running. For example, if a process in+/batchjobs/container_id1 cgroup calls unshare, cgroup+/batchjobs/container_id1 becomes the cgroupns root. For the+init_cgroup_ns, this is the real root ('/') cgroup.++The cgroupns root cgroup does not change even if the namespace creator+process later moves to a different cgroup.++ # ~/unshare -c # unshare cgroupns in some cgroup+ # cat /proc/self/cgroup+ 0::/+ # mkdir sub_cgrp_1+ # echo 0 > sub_cgrp_1/cgroup.procs+ # cat /proc/self/cgroup+ 0::/sub_cgrp_1++Each process gets its namespace-specific view of "/proc/$PID/cgroup"++Processes running inside the cgroup namespace will be able to see+cgroup paths (in /proc/self/cgroup) only inside their root cgroup.+From within an unshared cgroupns:++ # sleep 100000 &+ [1] 7353+ # echo 7353 > sub_cgrp_1/cgroup.procs+ # cat /proc/7353/cgroup+ 0::/sub_cgrp_1++From the initial cgroup namespace, the real cgroup path will be+visible:++ $ cat /proc/7353/cgroup+ 0::/batchjobs/container_id1/sub_cgrp_1++From a sibling cgroup namespace (that is, a namespace rooted at a+different cgroup), the cgroup path relative to its own cgroup+namespace root will be shown. For instance, if PID 7353's cgroup+namespace root is at '/batchjobs/container_id2', then it will see++ # cat /proc/7353/cgroup+ 0::/../container_id2/sub_cgrp_1++Note that the relative path always starts with '/' to indicate that+its relative to the cgroup namespace root of the caller.+++6-3. Migration and setns(2)++Processes inside a cgroup namespace can move into and out of the+namespace root if they have proper access to external cgroups. For+example, from inside a namespace with cgroupns root at+/batchjobs/container_id1, and assuming that the global hierarchy is+still accessible inside cgroupns:++ # cat /proc/7353/cgroup+ 0::/sub_cgrp_1+ # echo 7353 > batchjobs/container_id2/cgroup.procs+ # cat /proc/7353/cgroup+ 0::/../container_id2++Note that this kind of setup is not encouraged. A task inside cgroup+namespace should only be exposed to its own cgroupns hierarchy.++setns(2) to another cgroup namespace is allowed when:++(a) the process has CAP_SYS_ADMIN against its current user namespace+(b) the process has CAP_SYS_ADMIN against the target cgroup+ namespace's userns++No implicit cgroup changes happen with attaching to another cgroup+namespace. It is expected that the someone moves the attaching+process under the target cgroup namespace root.+++6-4. Interaction with Other Namespaces++Namespace specific cgroup hierarchy can be mounted by a process+running inside a non-init cgroup namespace.++ # mount -t cgroup2 none $MOUNT_POINT++This will mount the unified cgroup hierarchy with cgroupns root as the+filesystem root. The process needs CAP_SYS_ADMIN against its user and+mount namespaces.++The virtualization of /proc/self/cgroup file combined with restricting+the view of cgroup hierarchy by namespace-private cgroupfs mount+provides a properly isolated cgroup view inside the container.++ P. Information on Kernel Programming This section contains kernel programming information in the areas
Happy New Year!
I'm hitting both a build and boot regression in -next with these
patches. The bisect log reports:
git bisect skip f176ae3a5df610e0373c39538cc7744c7788b3df
# bad: [54b39d263704b66cc8006ce8f7dd4743fdabae70] cgroup: cgroup
namespace setns support
git bisect bad 54b39d263704b66cc8006ce8f7dd4743fdabae70
# good: [bf9b3590879afbaa54148d817ed68a0b51180375] sched: new clone
flag CLONE_NEWCGROUP for c
group namespace
git bisect good bf9b3590879afbaa54148d817ed68a0b51180375
# only skipped commits left to test
# possible first bad commit:
[54b39d263704b66cc8006ce8f7dd4743fdabae70] cgroup: cgroup namespa
ce setns support
# possible first bad commit:
[f176ae3a5df610e0373c39538cc7744c7788b3df] cgroup: introduce cgro
up namespaces
Where compiling "f176ae3a5df6" fails with:
kernel/cgroup.c: In function ‘cgroupns_put’:
kernel/cgroup.c:5956:2: error: implicit declaration of function
‘to_cg_ns’ [-Werror=implicit-f
unction-declaration]
put_cgroup_ns(to_cg_ns(ns));
^
kernel/cgroup.c:5956:16: warning: passing argument 1 of
‘put_cgroup_ns’ makes pointer from int
eger without a cast
put_cgroup_ns(to_cg_ns(ns));
^
In file included from kernel/cgroup.c:31:0:
include/linux/cgroup.h:609:60: note: expected ‘struct cgroup_namespace
*’ but argument is of t
ype ‘int’
static inline void put_cgroup_ns(struct cgroup_namespace *ns)
^
kernel/cgroup.c: At top level:
kernel/cgroup.c:5964:2: warning: initialization from incompatible pointer type
.install = cgroupns_install,
^
kernel/cgroup.c:5964:2: warning: (near initialization for
‘cgroupns_operations.install’)
cc1: some warnings being treated as errors
...and booting "54b39d263704" fails with the following log:
[ 3.963105] BUG: unable to handle kernel NULL pointer dereference at
0000000000000030
[ 3.963110] IP: [<ffffffff81143f3d>] cgroup_path+0x3d/0x90
https://gist.github.com/djbw/1d30cd323d802e3d9d07
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/containers
Happy New Year!
I'm hitting both a build and boot regression in -next with these
patches. The bisect log reports:
git bisect skip f176ae3a5df610e0373c39538cc7744c7788b3df
# bad: [54b39d263704b66cc8006ce8f7dd4743fdabae70] cgroup: cgroup
namespace setns support
git bisect bad 54b39d263704b66cc8006ce8f7dd4743fdabae70
# good: [bf9b3590879afbaa54148d817ed68a0b51180375] sched: new clone
flag CLONE_NEWCGROUP for c
group namespace
git bisect good bf9b3590879afbaa54148d817ed68a0b51180375
# only skipped commits left to test
# possible first bad commit:
[54b39d263704b66cc8006ce8f7dd4743fdabae70] cgroup: cgroup namespa
ce setns support
# possible first bad commit:
[f176ae3a5df610e0373c39538cc7744c7788b3df] cgroup: introduce cgro
up namespaces
Where compiling "f176ae3a5df6" fails with:
kernel/cgroup.c: In function ‘cgroupns_put’:
kernel/cgroup.c:5956:2: error: implicit declaration of function
‘to_cg_ns’ [-Werror=implicit-f
unction-declaration]
put_cgroup_ns(to_cg_ns(ns));
Happy New Year!
I'm hitting both a build and boot regression in -next with these
patches. The bisect log reports:
git bisect skip f176ae3a5df610e0373c39538cc7744c7788b3df
# bad: [54b39d263704b66cc8006ce8f7dd4743fdabae70] cgroup: cgroup
namespace setns support
git bisect bad 54b39d263704b66cc8006ce8f7dd4743fdabae70
# good: [bf9b3590879afbaa54148d817ed68a0b51180375] sched: new clone
flag CLONE_NEWCGROUP for c
group namespace
git bisect good bf9b3590879afbaa54148d817ed68a0b51180375
# only skipped commits left to test
# possible first bad commit:
[54b39d263704b66cc8006ce8f7dd4743fdabae70] cgroup: cgroup namespa
ce setns support
# possible first bad commit:
[f176ae3a5df610e0373c39538cc7744c7788b3df] cgroup: introduce cgro
up namespaces
Where compiling "f176ae3a5df6" fails with:
kernel/cgroup.c: In function ‘cgroupns_put’:
kernel/cgroup.c:5956:2: error: implicit declaration of function
‘to_cg_ns’ [-Werror=implicit-f
unction-declaration]
put_cgroup_ns(to_cg_ns(ns));
Right, but it's not defined until commit 54b39d263704 "cgroup: cgroup
namespace setns support", however it is first used in the preceeding
commit f176ae3a5df6 "cgroup: introduce cgroup namespaces". The bad
patch ordering breaks bisection.
Commit 54b39d263704 "cgroup: cgroup namespace setns support" not
booting is a separate issue.
Happy New Year!
I'm hitting both a build and boot regression in -next with these
patches. The bisect log reports:
git bisect skip f176ae3a5df610e0373c39538cc7744c7788b3df
# bad: [54b39d263704b66cc8006ce8f7dd4743fdabae70] cgroup: cgroup
namespace setns support
git bisect bad 54b39d263704b66cc8006ce8f7dd4743fdabae70
# good: [bf9b3590879afbaa54148d817ed68a0b51180375] sched: new clone
flag CLONE_NEWCGROUP for c
group namespace
git bisect good bf9b3590879afbaa54148d817ed68a0b51180375
# only skipped commits left to test
# possible first bad commit:
[54b39d263704b66cc8006ce8f7dd4743fdabae70] cgroup: cgroup namespa
ce setns support
# possible first bad commit:
[f176ae3a5df610e0373c39538cc7744c7788b3df] cgroup: introduce cgro
up namespaces
Where compiling "f176ae3a5df6" fails with:
kernel/cgroup.c: In function ‘cgroupns_put’:
kernel/cgroup.c:5956:2: error: implicit declaration of function
‘to_cg_ns’ [-Werror=implicit-f
unction-declaration]
put_cgroup_ns(to_cg_ns(ns));
Right, but it's not defined until commit 54b39d263704 "cgroup: cgroup
namespace setns support", however it is first used in the preceeding
commit f176ae3a5df6 "cgroup: introduce cgroup namespaces". The bad
patch ordering breaks bisection.
Commit 54b39d263704 "cgroup: cgroup namespace setns support" not
booting is a separate issue.
Oh - been there since my first version of the set (v4). Odd, I
thought that the automated korg testing caught those.
What is the simplest way to fix this? Do I send new versions of
patches v3 and v4? Does Tejun or Stephen just do it inline in the
git tree? Do we leave it be?
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/containers
From: Dan Williams <hidden> Date: 2016-01-01 19:14:18
On Fri, Jan 1, 2016 at 10:06 AM, Serge E. Hallyn
[off-list ref] wrote:
On Fri, Jan 01, 2016 at 01:42:57AM -0800, Dan Williams wrote:
quoted
Commit 54b39d263704 "cgroup: cgroup namespace setns support" not
booting is a separate issue.
Oh - been there since my first version of the set (v4). Odd, I
thought that the automated korg testing caught those.
What is the simplest way to fix this? Do I send new versions of
patches v3 and v4? Does Tejun or Stephen just do it inline in the
git tree? Do we leave it be?
I'm assuming it can be fixed up when you re-spin the patches to fix
the boot failure.
On Fri, Jan 01, 2016 at 11:14:14AM -0800, Dan Williams wrote:
On Fri, Jan 1, 2016 at 10:06 AM, Serge E. Hallyn
[off-list ref] wrote:
quoted
On Fri, Jan 01, 2016 at 01:42:57AM -0800, Dan Williams wrote:
quoted
Commit 54b39d263704 "cgroup: cgroup namespace setns support" not
booting is a separate issue.
Oh - been there since my first version of the set (v4). Odd, I
thought that the automated korg testing caught those.
What is the simplest way to fix this? Do I send new versions of
patches v3 and v4? Does Tejun or Stephen just do it inline in the
git tree? Do we leave it be?
I'm assuming it can be fixed up when you re-spin the patches to fix
the boot failure.
I reverted the cgroup namespace patchset for the time being.
Thanks.
--
tejun
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel