Issue a panic in the case of a failed mount promise.

Failing to resolve a mount promise is never expected behavior. The
sandbox should crash in this case, since something has gone
fatally wrong.

PiperOrigin-RevId: 552652799
This commit is contained in:
Lucas Manning
2023-07-31 18:57:25 -07:00
committed by gVisor bot
parent 1d4792c566
commit e77ec6e719
+1 -2
View File
@@ -47,7 +47,6 @@ import (
"gvisor.dev/gvisor/pkg/errors/linuxerr"
"gvisor.dev/gvisor/pkg/eventchannel"
"gvisor.dev/gvisor/pkg/fspath"
"gvisor.dev/gvisor/pkg/log"
"gvisor.dev/gvisor/pkg/sentry/fsmetric"
"gvisor.dev/gvisor/pkg/sentry/kernel/auth"
"gvisor.dev/gvisor/pkg/sentry/socket/unix/transport"
@@ -947,7 +946,7 @@ func (vfs *VirtualFilesystem) maybeBlockOnMountPromise(ctx context.Context, rp *
rp.start = newMnt.root
rp.flags = rp.flags&^rpflagsHaveStartRef | rpflagsHaveMountRef
case <-time.After(mountPromiseTimeout):
log.Warningf("mount promise for %s timed out, proceeding with VFS operation", path)
panic(fmt.Sprintf("mount promise for %s timed out, unable to proceed", path))
}
}