summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/devtmpfs
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/sentry/fsimpl/devtmpfs')
-rw-r--r--pkg/sentry/fsimpl/devtmpfs/devtmpfs.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/sentry/fsimpl/devtmpfs/devtmpfs.go b/pkg/sentry/fsimpl/devtmpfs/devtmpfs.go
index ed729e480..e6fe0fc0d 100644
--- a/pkg/sentry/fsimpl/devtmpfs/devtmpfs.go
+++ b/pkg/sentry/fsimpl/devtmpfs/devtmpfs.go
@@ -95,10 +95,13 @@ func NewAccessor(ctx context.Context, vfsObj *vfs.VirtualFilesystem, creds *auth
if err != nil {
return nil, err
}
+ // Pass a reference on root to the Accessor.
+ root := mntns.Root()
+ root.IncRef()
return &Accessor{
vfsObj: vfsObj,
mntns: mntns,
- root: mntns.Root(),
+ root: root,
creds: creds,
}, nil
}