From 055de38fcf1159c7b3ce3e05b8ec0fcf07f635dc Mon Sep 17 00:00:00 2001 From: Chirantan Ekbote Date: Fri, 24 Jan 2020 12:16:58 +0900 Subject: Allow mounts to propagate into 9p device jail Allow mounts from the parent namespace to propagate into the mount namespace of the 9p device process. BUG=none TEST=none Change-Id: Iff455c8967949bd3e0f2990c947d45bbbc541d45 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2018305 Reviewed-by: Yusuke Sato Reviewed-by: Stephen Barber Tested-by: Yusuke Sato Tested-by: kokoro Tested-by: Chirantan Ekbote Commit-Queue: Chirantan Ekbote --- src/linux.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/linux.rs') diff --git a/src/linux.rs b/src/linux.rs index a26e7bb..84edf5c 100644 --- a/src/linux.rs +++ b/src/linux.rs @@ -825,6 +825,10 @@ fn create_9p_device(cfg: &Config, src: &Path, tag: &str) -> DeviceResult { let root = Path::new("/"); jail.mount_bind(src, root, true)?; + // We want bind mounts from the parent namespaces to propagate into the 9p server's + // namespace. + jail.set_remount_mode(libc::MS_SLAVE); + add_crosvm_user_to_jail(&mut jail, "p9")?; (Some(jail), root) } -- cgit 1.4.1