summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/loader
diff options
context:
space:
mode:
authorIan Gudger <igudger@google.com>2019-06-13 18:39:43 -0700
committerShentubot <shentubot@google.com>2019-06-13 18:40:38 -0700
commit3e9b8ecbfe21ba6c8c788be469fc6cea6a4a40b7 (patch)
tree8a1b2a0e64c013503ff30bf4b49b28764db52680 /pkg/sentry/loader
parent0a5ee6f7b20ef4f5533766d753b85005f79ae613 (diff)
Plumb context through more layers of filesytem.
All functions which allocate objects containing AtomicRefCounts will soon need a context. PiperOrigin-RevId: 253147709
Diffstat (limited to 'pkg/sentry/loader')
-rw-r--r--pkg/sentry/loader/vdso.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/pkg/sentry/loader/vdso.go b/pkg/sentry/loader/vdso.go
index 4ba56c44d..ada28aea3 100644
--- a/pkg/sentry/loader/vdso.go
+++ b/pkg/sentry/loader/vdso.go
@@ -69,11 +69,12 @@ type byteReader struct {
var _ fs.FileOperations = (*byteReader)(nil)
// newByteReaderFile creates a fake file to read data from.
-func newByteReaderFile(data []byte) *fs.File {
+func newByteReaderFile(ctx context.Context, data []byte) *fs.File {
// Create a fake inode.
inode := fs.NewInode(
+ ctx,
&fsutil.SimpleFileInode{},
- fs.NewPseudoMountSource(),
+ fs.NewPseudoMountSource(ctx),
fs.StableAttr{
Type: fs.Anonymous,
DeviceID: anon.PseudoDevice.DeviceID(),
@@ -219,8 +220,8 @@ type VDSO struct {
// PrepareVDSO validates the system VDSO and returns a VDSO, containing the
// param page for updating by the kernel.
-func PrepareVDSO(mfp pgalloc.MemoryFileProvider) (*VDSO, error) {
- vdsoFile := newByteReaderFile(vdsoBin)
+func PrepareVDSO(ctx context.Context, mfp pgalloc.MemoryFileProvider) (*VDSO, error) {
+ vdsoFile := newByteReaderFile(ctx, vdsoBin)
// First make sure the VDSO is valid. vdsoFile does not use ctx, so a
// nil context can be passed.