]> 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 13:02:09 +0000 (09:02 -0400)
commita7c1b4d68062f99f6219824b6f2b02bf8dd90abd
tree416a8ee2522003f632e1dfc4e784266158f15cfd
parentb57501721fef8485869cb7ee15898288ab11944f
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