summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/proc/tasks.go
diff options
context:
space:
mode:
authorSteve Silva <stevesilva@google.com>2021-05-06 18:00:49 -0700
committergVisor bot <gvisor-bot@google.com>2021-05-06 18:03:42 -0700
commit339001204000a3060628256cd9131ea2a2d4e08a (patch)
tree518e103c362ebd106fdf96cedb1d08fdade42376 /pkg/sentry/fsimpl/proc/tasks.go
parent9800fd8e4717133476afb9bdc64f8384c53f82dd (diff)
Implement /proc/cmdline
This change implements /proc/cmdline with a basic faux command line "BOOT_IMAGE=/vmlinuz-[version]-gvisor quiet" so apps that may expect it do not receive errors. Also tests for the existence of /proc/cmdline as part of the system call test suite PiperOrigin-RevId: 372462070
Diffstat (limited to 'pkg/sentry/fsimpl/proc/tasks.go')
-rw-r--r--pkg/sentry/fsimpl/proc/tasks.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/pkg/sentry/fsimpl/proc/tasks.go b/pkg/sentry/fsimpl/proc/tasks.go
index 7c7543f14..cf905fae4 100644
--- a/pkg/sentry/fsimpl/proc/tasks.go
+++ b/pkg/sentry/fsimpl/proc/tasks.go
@@ -65,6 +65,7 @@ var _ kernfs.Inode = (*tasksInode)(nil)
func (fs *filesystem) newTasksInode(ctx context.Context, k *kernel.Kernel, pidns *kernel.PIDNamespace, fakeCgroupControllers map[string]string) *tasksInode {
root := auth.NewRootCredentials(pidns.UserNamespace())
contents := map[string]kernfs.Inode{
+ "cmdline": fs.newInode(ctx, root, 0444, &cmdLineData{}),
"cpuinfo": fs.newInode(ctx, root, 0444, newStaticFileSetStat(cpuInfoData(k))),
"filesystems": fs.newInode(ctx, root, 0444, &filesystemsData{}),
"loadavg": fs.newInode(ctx, root, 0444, &loadavgData{}),