diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-08-04 09:29:11 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-08-04 09:31:11 -0700 |
commit | d64ba89da3a5e8aaf28a9da1b40cb2231a4c6b42 (patch) | |
tree | 3eaf64546b3f2a3a2e1c452376ac54e1a6e28b7c /pkg/sentry | |
parent | 1bdadbc4f84bf5aacd63d1f486d4c4610dea4110 (diff) |
Internal change.
PiperOrigin-RevId: 324826968
Diffstat (limited to 'pkg/sentry')
-rw-r--r-- | pkg/sentry/fsimpl/testutil/kernel.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/sentry/fsimpl/testutil/kernel.go b/pkg/sentry/fsimpl/testutil/kernel.go index 1e57744e8..1813269e0 100644 --- a/pkg/sentry/fsimpl/testutil/kernel.go +++ b/pkg/sentry/fsimpl/testutil/kernel.go @@ -122,6 +122,10 @@ func Boot() (*kernel.Kernel, error) { // CreateTask creates a new bare bones task for tests. func CreateTask(ctx context.Context, name string, tc *kernel.ThreadGroup, mntns *vfs.MountNamespace, root, cwd vfs.VirtualDentry) (*kernel.Task, error) { k := kernel.KernelFromContext(ctx) + if k == nil { + return nil, fmt.Errorf("cannot find kernel from context") + } + exe, err := newFakeExecutable(ctx, k.VFS(), auth.CredentialsFromContext(ctx), root) if err != nil { return nil, err |