diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-02-14 11:11:55 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-02-14 11:12:47 -0800 |
commit | 4075de11be44372c454aae7f9650cdc814c52229 (patch) | |
tree | 6c61b83a9cfd07af87446262f917652f58c5205f /pkg/sentry/vfs/context.go | |
parent | b2e86906ea4f7bc43b8d2d3a4735a87eca779b33 (diff) |
Plumb VFS2 inside the Sentry
- Added fsbridge package with interface that can be used to open
and read from VFS1 and VFS2 files.
- Converted ELF loader to use fsbridge
- Added VFS2 types to FSContext
- Added vfs.MountNamespace to ThreadGroup
Updates #1623
PiperOrigin-RevId: 295183950
Diffstat (limited to 'pkg/sentry/vfs/context.go')
-rw-r--r-- | pkg/sentry/vfs/context.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/sentry/vfs/context.go b/pkg/sentry/vfs/context.go index d97362b9a..82781e6d3 100644 --- a/pkg/sentry/vfs/context.go +++ b/pkg/sentry/vfs/context.go @@ -29,9 +29,10 @@ const ( CtxRoot ) -// MountNamespaceFromContext returns the MountNamespace used by ctx. It does -// not take a reference on the returned MountNamespace. If ctx is not -// associated with a MountNamespace, MountNamespaceFromContext returns nil. +// MountNamespaceFromContext returns the MountNamespace used by ctx. If ctx is +// not associated with a MountNamespace, MountNamespaceFromContext returns nil. +// +// A reference is taken on the returned MountNamespace. func MountNamespaceFromContext(ctx context.Context) *MountNamespace { if v := ctx.Value(CtxMountNamespace); v != nil { return v.(*MountNamespace) |