diff options
| author | Daniel Golle | 2020-07-13 08:57:05 +0000 |
|---|---|---|
| committer | Daniel Golle | 2020-07-13 11:14:49 +0000 |
| commit | b586e7d693d39247d854b03c15610173b7a42f61 (patch) | |
| tree | cb910b5110f83c746ae563fc0918c154c59d647b | |
| parent | 71e75f401133510b91555ae7a457191a972b48ba (diff) | |
| download | procd-b586e7d693d39247d854b03c15610173b7a42f61.tar.gz | |
jail: don't make mount source read-only
From mount(2):
Specifying mountflags as:
MS_REMOUNT | MS_BIND | MS_RDONLY
will make access through this mountpoint read-only, without affecting
other mount points.
Hence use MS_BIND when remounting container rootfs read-only.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
| -rw-r--r-- | jail/jail.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/jail/jail.c b/jail/jail.c index e8abd8a..aa6288e 100644 --- a/jail/jail.c +++ b/jail/jail.c @@ -533,7 +533,7 @@ static int build_jail_fs(void) mount("sysfs", "/sys", "sysfs", MS_NOATIME | MS_NODEV | MS_NOEXEC | MS_NOSUID | MS_RDONLY, 0); } if (opts.ronly) - mount(NULL, "/", NULL, MS_RDONLY | MS_REMOUNT, 0); + mount(NULL, "/", NULL, MS_REMOUNT | MS_BIND | MS_RDONLY, 0); return 0; } |