mirror of
https://github.com/systemd/systemd
synced 2024-09-06 08:46:19 +00:00
namespace: remount namespace root dir for SLAVE to avoid propagation of mounts from the namespace to the host
https://bugzilla.redhat.com/show_bug.cgi?id=752540
This commit is contained in:
parent
86aa7ba4f9
commit
dc4b020064
|
@ -266,8 +266,12 @@ int setup_namespace(
|
|||
goto fail;
|
||||
}
|
||||
|
||||
/* We assume that by default mount events from us won't be
|
||||
* propagated to the root namespace. */
|
||||
/* Remount / as SLAVE so that nothing mounted in the namespace
|
||||
shows up in the parent */
|
||||
if (mount(NULL, "/", NULL, MS_SLAVE|MS_REC, NULL) < 0) {
|
||||
r = -errno;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
for (p = paths; p < paths + n; p++)
|
||||
if ((r = apply_mount(p, root_dir, inaccessible_dir, private_dir, flags)) < 0)
|
||||
|
|
Loading…
Reference in a new issue