From 34d45e589f7cc22e342e49db84b56609ca95b90f Mon Sep 17 00:00:00 2001 From: Chirantan Ekbote Date: Mon, 20 Apr 2020 18:15:02 +0900 Subject: linux.rs: Set MS_SLAVE mount propagation for virtio-fs Allow mounts from the parent namespace to propagate into the virtio-fs device's mount namespace. BUG=b:123377807 TEST=vm.Fio.virtiofs_stress_rw and manual Change-Id: I1b8f1b411bd72a8cf5d5b4b30fa5dad466f1e48f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2156327 Reviewed-by: Stephen Barber Tested-by: kokoro Commit-Queue: Chirantan Ekbote --- src/linux.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/linux.rs') diff --git a/src/linux.rs b/src/linux.rs index cebfa77..e480a4c 100644 --- a/src/linux.rs +++ b/src/linux.rs @@ -819,7 +819,12 @@ fn create_fs_device( log_failures: cfg.seccomp_log_failures, seccomp_policy: &seccomp_policy, }; - create_base_minijail(src, Some(max_open_files), Some(&config))? + let mut jail = create_base_minijail(src, Some(max_open_files), Some(&config))?; + // We want bind mounts from the parent namespaces to propagate into the fs device's + // namespace. + jail.set_remount_mode(libc::MS_SLAVE); + + jail } else { create_base_minijail(src, Some(max_open_files), None)? }; -- cgit 1.4.1