summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/proc
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2019-11-27 02:23:28 +0000
committergVisor bot <gvisor-bot@google.com>2019-11-27 02:23:28 +0000
commit71e5ce0d31623f55021f9935db29029b2ab5523a (patch)
tree5adcb6f0e1c8de11051ac09ef6c1c7bf5766bc83 /pkg/sentry/fs/proc
parent38a00b7cdbd1d3f0b3fe49157e402b32f5c989e8 (diff)
parent20279c305ece6a458006999c8dafc5672ca92803 (diff)
Merge release-20191114.0-39-g20279c3 (automated)
Diffstat (limited to 'pkg/sentry/fs/proc')
-rwxr-xr-xpkg/sentry/fs/proc/proc_state_autogen.go4
-rw-r--r--pkg/sentry/fs/proc/sys_net.go17
2 files changed, 16 insertions, 5 deletions
diff --git a/pkg/sentry/fs/proc/proc_state_autogen.go b/pkg/sentry/fs/proc/proc_state_autogen.go
index eedd011a8..1fc5cece2 100755
--- a/pkg/sentry/fs/proc/proc_state_autogen.go
+++ b/pkg/sentry/fs/proc/proc_state_autogen.go
@@ -382,15 +382,15 @@ func (x *tcpMemFile) load(m state.Map) {
func (x *tcpSack) beforeSave() {}
func (x *tcpSack) save(m state.Map) {
x.beforeSave()
+ m.Save("SimpleFileInode", &x.SimpleFileInode)
m.Save("stack", &x.stack)
m.Save("enabled", &x.enabled)
- m.Save("SimpleFileInode", &x.SimpleFileInode)
}
func (x *tcpSack) load(m state.Map) {
+ m.Load("SimpleFileInode", &x.SimpleFileInode)
m.LoadWait("stack", &x.stack)
m.Load("enabled", &x.enabled)
- m.Load("SimpleFileInode", &x.SimpleFileInode)
m.AfterLoad(x.afterLoad)
}
diff --git a/pkg/sentry/fs/proc/sys_net.go b/pkg/sentry/fs/proc/sys_net.go
index f3b63dfc2..bd93f83fa 100644
--- a/pkg/sentry/fs/proc/sys_net.go
+++ b/pkg/sentry/fs/proc/sys_net.go
@@ -64,7 +64,7 @@ var _ fs.InodeOperations = (*tcpMemInode)(nil)
func newTCPMemInode(ctx context.Context, msrc *fs.MountSource, s inet.Stack, dir tcpMemDir) *fs.Inode {
tm := &tcpMemInode{
- SimpleFileInode: *fsutil.NewSimpleFileInode(ctx, fs.RootOwner, fs.FilePermsFromMode(0444), linux.PROC_SUPER_MAGIC),
+ SimpleFileInode: *fsutil.NewSimpleFileInode(ctx, fs.RootOwner, fs.FilePermsFromMode(0644), linux.PROC_SUPER_MAGIC),
s: s,
dir: dir,
}
@@ -77,6 +77,11 @@ func newTCPMemInode(ctx context.Context, msrc *fs.MountSource, s inet.Stack, dir
return fs.NewInode(ctx, tm, msrc, sattr)
}
+// Truncate implements fs.InodeOperations.Truncate.
+func (tcpMemInode) Truncate(context.Context, *fs.Inode, int64) error {
+ return nil
+}
+
// GetFile implements fs.InodeOperations.GetFile.
func (m *tcpMemInode) GetFile(ctx context.Context, dirent *fs.Dirent, flags fs.FileFlags) (*fs.File, error) {
flags.Pread = true
@@ -168,14 +173,15 @@ func writeSize(dirType tcpMemDir, s inet.Stack, size inet.TCPBufferSize) error {
// +stateify savable
type tcpSack struct {
+ fsutil.SimpleFileInode
+
stack inet.Stack `state:"wait"`
enabled *bool
- fsutil.SimpleFileInode
}
func newTCPSackInode(ctx context.Context, msrc *fs.MountSource, s inet.Stack) *fs.Inode {
ts := &tcpSack{
- SimpleFileInode: *fsutil.NewSimpleFileInode(ctx, fs.RootOwner, fs.FilePermsFromMode(0444), linux.PROC_SUPER_MAGIC),
+ SimpleFileInode: *fsutil.NewSimpleFileInode(ctx, fs.RootOwner, fs.FilePermsFromMode(0644), linux.PROC_SUPER_MAGIC),
stack: s,
}
sattr := fs.StableAttr{
@@ -187,6 +193,11 @@ func newTCPSackInode(ctx context.Context, msrc *fs.MountSource, s inet.Stack) *f
return fs.NewInode(ctx, ts, msrc, sattr)
}
+// Truncate implements fs.InodeOperations.Truncate.
+func (tcpSack) Truncate(context.Context, *fs.Inode, int64) error {
+ return nil
+}
+
// GetFile implements fs.InodeOperations.GetFile.
func (s *tcpSack) GetFile(ctx context.Context, dirent *fs.Dirent, flags fs.FileFlags) (*fs.File, error) {
flags.Pread = true