vfs: Don't allow to mount anything on top of detached mounts

PiperOrigin-RevId: 376932659
This commit is contained in:
Andrei Vagin
2021-06-01 15:33:50 -07:00
committed by gVisor bot
parent 77dc0f5bc9
commit d7d8a0a5ae
+1 -1
View File
@@ -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)