]> git.ipfire.org Git - thirdparty/lxc.git/commit
do_mount_entry: add nexec, nosuid, nodev, rdonly flags if needed at remount
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 18 Aug 2014 03:28:21 +0000 (03:28 +0000)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 18 Aug 2014 03:40:28 +0000 (23:40 -0400)
commit6fd5e7699f651ad16815f9f2bd56bc8dc4227224
tree5faebeba62996c775f8a92d42e4326e75a574fad
parent073135baa78511c26e502362840f2c950cfddfe2
do_mount_entry: add nexec, nosuid, nodev, rdonly flags if needed at remount

See http://lkml.org/lkml/2014/8/13/746 and its history.  The kernel now refuses
mounts if we don't add ro,nosuid,nodev,noexec flags if they were already there.

Also use the newly found info to skip remount if unneeded.  For background, if
you want to create a read-only bind mount, then you must first mount(2) with
MS_BIND to create the bind mount, then re-mount(2) again to get the new mount
options to apply.  So if this wasn't a bind mount, or no new mount options were
introduced, then we don't do the second mount(2).

null_endofword() and get_field() were not changed, only moved up in
the file.

(Note, while I can start containers inside a privileged container with
this patch, most of the lxc tests still fail with the kernel in question;
Andy's patch seems to still be needed - a kernel with which is available
at https://launchpad.net/~serge-hallyn/+archive/ubuntu/userns-natty
ppa:serge-hallyn/userns-natty)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/conf.c