diff options
author | Chirantan Ekbote <chirantan@chromium.org> | 2020-01-24 12:16:58 +0900 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-02-04 13:33:06 +0000 |
commit | 055de38fcf1159c7b3ce3e05b8ec0fcf07f635dc (patch) | |
tree | cfb71b2cf12d63a358fd5c346111d5dcc9c0f4f4 /src/linux.rs | |
parent | df2bfe30f3c1712427efb1ceab2841cfaafa64fd (diff) | |
download | crosvm-055de38fcf1159c7b3ce3e05b8ec0fcf07f635dc.tar crosvm-055de38fcf1159c7b3ce3e05b8ec0fcf07f635dc.tar.gz crosvm-055de38fcf1159c7b3ce3e05b8ec0fcf07f635dc.tar.bz2 crosvm-055de38fcf1159c7b3ce3e05b8ec0fcf07f635dc.tar.lz crosvm-055de38fcf1159c7b3ce3e05b8ec0fcf07f635dc.tar.xz crosvm-055de38fcf1159c7b3ce3e05b8ec0fcf07f635dc.tar.zst crosvm-055de38fcf1159c7b3ce3e05b8ec0fcf07f635dc.zip |
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 <yusukes@chromium.org> Reviewed-by: Stephen Barber <smbarber@chromium.org> Tested-by: Yusuke Sato <yusukes@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Chirantan Ekbote <chirantan@chromium.org> Commit-Queue: Chirantan Ekbote <chirantan@chromium.org>
Diffstat (limited to 'src/linux.rs')
-rw-r--r-- | src/linux.rs | 4 |
1 files changed, 4 insertions, 0 deletions
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) } |