summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/proc/filesystem.go
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2020-01-17 10:39:24 -0800
committergVisor bot <gvisor-bot@google.com>2020-01-17 10:41:44 -0800
commit8e8d0f96f651ce161dfe6003d738dbda28f7cb0e (patch)
tree08294a03f9f8fb44790ef03fca4d8df490e69d07 /pkg/sentry/fsimpl/proc/filesystem.go
parentff9960985848a48863c01f91acd5b34d3e83a9c5 (diff)
Add /proc/[pid]/cgroups file
Updates #1195 PiperOrigin-RevId: 290298266
Diffstat (limited to 'pkg/sentry/fsimpl/proc/filesystem.go')
-rw-r--r--pkg/sentry/fsimpl/proc/filesystem.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/pkg/sentry/fsimpl/proc/filesystem.go b/pkg/sentry/fsimpl/proc/filesystem.go
index e9cb7895f..f49819187 100644
--- a/pkg/sentry/fsimpl/proc/filesystem.go
+++ b/pkg/sentry/fsimpl/proc/filesystem.go
@@ -47,7 +47,12 @@ func (ft *procFSType) GetFilesystem(ctx context.Context, vfsObj *vfs.VirtualFile
procfs := &kernfs.Filesystem{}
procfs.VFSFilesystem().Init(vfsObj, procfs)
- _, dentry := newTasksInode(procfs, k, pidns)
+ var data *InternalData
+ if opts.InternalData != nil {
+ data = opts.InternalData.(*InternalData)
+ }
+
+ _, dentry := newTasksInode(procfs, k, pidns, data.Cgroups)
return procfs.VFSFilesystem(), dentry.VFSDentry(), nil
}
@@ -78,3 +83,9 @@ var _ dynamicInode = (*staticFile)(nil)
func newStaticFile(data string) *staticFile {
return &staticFile{StaticData: vfs.StaticData{Data: data}}
}
+
+// InternalData contains internal data passed in to the procfs mount via
+// vfs.GetFilesystemOptions.InternalData.
+type InternalData struct {
+ Cgroups map[string]string
+}