summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/proc/sys.go
diff options
context:
space:
mode:
authorBrian Geffon <bgeffon@google.com>2018-08-27 17:20:36 -0700
committerShentubot <shentubot@google.com>2018-08-27 17:21:37 -0700
commitf0492d45aa31e32f8a04b13b7bf53e0161e1afb6 (patch)
tree78ef1626271ba6c96e0482c2e19874774887aa3b /pkg/sentry/fs/proc/sys.go
parent0923bcf06bffe0216cd685f49e83a07201d48cc3 (diff)
Add /proc/sys/kernel/shm[all,max,mni].
PiperOrigin-RevId: 210459956 Change-Id: I51859b90fa967631e0a54a390abc3b5541fbee66
Diffstat (limited to 'pkg/sentry/fs/proc/sys.go')
-rw-r--r--pkg/sentry/fs/proc/sys.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/sentry/fs/proc/sys.go b/pkg/sentry/fs/proc/sys.go
index a2d36ca23..384b4ffe1 100644
--- a/pkg/sentry/fs/proc/sys.go
+++ b/pkg/sentry/fs/proc/sys.go
@@ -17,7 +17,9 @@ package proc
import (
"fmt"
"io"
+ "strconv"
+ "gvisor.googlesource.com/gvisor/pkg/abi/linux"
"gvisor.googlesource.com/gvisor/pkg/sentry/context"
"gvisor.googlesource.com/gvisor/pkg/sentry/fs"
"gvisor.googlesource.com/gvisor/pkg/sentry/fs/proc/seqfile"
@@ -102,6 +104,10 @@ func (p *proc) newKernelDir(ctx context.Context, msrc *fs.MountSource) *fs.Inode
d := &ramfs.Dir{}
d.InitDir(ctx, nil, fs.RootOwner, fs.FilePermsFromMode(0555))
d.AddChild(ctx, "hostname", p.newHostname(ctx, msrc))
+
+ d.AddChild(ctx, "shmmax", p.newStubProcFSFile(ctx, msrc, []byte(strconv.FormatUint(linux.SHMMAX, 10))))
+ d.AddChild(ctx, "shmall", p.newStubProcFSFile(ctx, msrc, []byte(strconv.FormatUint(linux.SHMALL, 10))))
+ d.AddChild(ctx, "shmmni", p.newStubProcFSFile(ctx, msrc, []byte(strconv.FormatUint(linux.SHMMNI, 10))))
return newFile(d, msrc, fs.SpecialDirectory, nil)
}