summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/vfs
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@google.com>2021-06-01 15:31:37 -0700
committergVisor bot <gvisor-bot@google.com>2021-06-01 15:33:50 -0700
commitd7d8a0a5aee841dd7958b0e6bc3b544016d19c24 (patch)
tree04ca80e6a682bb13db94c5020183e5bf1cac050f /pkg/sentry/vfs
parent77dc0f5bc94dff28fa23812f3ad60a8b01e91138 (diff)
vfs: Don't allow to mount anything on top of detached mounts
PiperOrigin-RevId: 376932659
Diffstat (limited to 'pkg/sentry/vfs')
-rw-r--r--pkg/sentry/vfs/mount.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/sentry/vfs/mount.go b/pkg/sentry/vfs/mount.go
index 82fd382c2..f93da3af1 100644
--- a/pkg/sentry/vfs/mount.go
+++ b/pkg/sentry/vfs/mount.go
@@ -220,7 +220,7 @@ func (vfs *VirtualFilesystem) ConnectMountAt(ctx context.Context, creds *auth.Cr
vdDentry := vd.dentry
vdDentry.mu.Lock()
for {
- if vdDentry.dead {
+ if vd.mount.umounted || vdDentry.dead {
vdDentry.mu.Unlock()
vfs.mountMu.Unlock()
vd.DecRef(ctx)