]> git.proxmox.com Git - mirror_lxc.git/commit - configure.ac
Add a nesting.conf which can be included to support nesting containers (v2)
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 3 Sep 2015 20:24:06 +0000 (20:24 +0000)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 21 Sep 2015 15:35:29 +0000 (11:35 -0400)
commit108b88ce3187e08cc630e17903f8e7748a545be1
tree00d8ce02f6b2570e3eb855c3da6e76f5d9c71f5f
parent76072aec5c984b9e91bd4344ab013e38d8bff311
Add a nesting.conf which can be included to support nesting containers (v2)

Newer kernels have added a new restriction:  if /proc or /sys on the
host has files or non-empty directories which are over-mounted, and
there is no /proc which fully visible, then it assumes there is a
"security" reason for this.  It prevents anyone in a non-initial user
namespace from creating a new proc or sysfs mount.

To work around this, this patch adds a new 'nesting.conf' which can be
lxc.include'd from a container configuration file.  It adds a
non-overmounted mount of /proc and /sys under /dev/.lxc, so that the
kernel can see that we're not trying to *hide* things like /proc/uptime.
and /sys/devices/virtual/net.  If the host adds this to the config file
for container w1, then container w1 will support unprivileged child
containers.

The nesting.conf file also sets the apparmor profile to the with-nesting
variant, since that is required anyway.  This actually means that
supporting nesting isn't really more work than it used to be, just
different.  Instead of adding

lxc.aa_profile = lxc-container-default-with-nesting

you now just need to

lxc.include = /usr/share/lxc/config/nesting.conf

(Look, fewer characters :)

Finally, in order to maintain the current apparmor protections on
proc and sys, we make /dev/.lxc/{proc,sys} non-read/writeable.
We don't need to be able to use them, we're just showing the
kernel what's what.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
config/apparmor/profiles/lxc-default-with-nesting
config/templates/Makefile.am
config/templates/nesting.conf.in [new file with mode: 0644]
configure.ac