[libvirt] [PATCH] lxc: stop rootless containers from messing with system mounts
Daniel P. Berrange
berrange at redhat.com
Wed Apr 15 09:02:16 UTC 2009
On Tue, Apr 07, 2009 at 10:14:23AM +0100, Daniel P. Berrange wrote:
> On Mon, Apr 06, 2009 at 01:47:42PM -0500, Serge E. Hallyn wrote:
> > If a container has no root, liblxc remounts /proc. If the
> > system had marked / as MS_SHARED, then even though the
> > container is in a new mounts namespace, the mount event is
> > propagated back to the host mounts namespace, overwriting
> > /proc. After that, for instance, ps will no longer show
> > system processes.
> >
> > A Fedora 11 default install has / MS_SHARED.
> >
> > Make sure that root is not MS_SHARED before remounting
> > /proc. I'm making it MS_SLAVE so that the container
> > will receive mount events from the host, but not vice
> > versa.
> >
> > Signed-off-by: Serge Hallyn <serue at us.ibm.com>
>
> Doh, that's rather annoying. ACK to this patch.
Was just about to commit this, but seems Dan Smith beat me to it. The
following pivot_root patch is committed too
Daniel
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
More information about the libvir-list
mailing list