diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-09-24 17:19:53 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-09-24 17:19:53 +0000 |
commit | 61cc049caaa2317eda73e66f65f82b5099dd2bc2 (patch) | |
tree | 352bfc9c114c181e052a9656be9f3b2acd5f7b33 /pkg/sentry/fsimpl/proc | |
parent | 3102024707dc370e025f1b46fa2be12eade2f9cb (diff) | |
parent | 0a7075f38a4870ded687e117a299ac4996c0673e (diff) |
Merge release-20200914.0-152-g0a7075f38 (automated)
Diffstat (limited to 'pkg/sentry/fsimpl/proc')
-rw-r--r-- | pkg/sentry/fsimpl/proc/filesystem.go | 7 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/proc/proc_state_autogen.go | 494 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/proc/subtasks.go | 1 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/proc/task.go | 2 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/proc/task_fds.go | 1 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/proc/task_files.go | 5 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/proc/task_net.go | 1 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/proc/tasks.go | 2 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/proc/tasks_files.go | 6 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/proc/tasks_sys.go | 1 |
10 files changed, 520 insertions, 0 deletions
diff --git a/pkg/sentry/fsimpl/proc/filesystem.go b/pkg/sentry/fsimpl/proc/filesystem.go index 03b5941b9..05d7948ea 100644 --- a/pkg/sentry/fsimpl/proc/filesystem.go +++ b/pkg/sentry/fsimpl/proc/filesystem.go @@ -41,6 +41,7 @@ func (FilesystemType) Name() string { return Name } +// +stateify savable type filesystem struct { kernfs.Filesystem @@ -84,6 +85,8 @@ func (fs *filesystem) Release(ctx context.Context) { // dynamicInode is an overfitted interface for common Inodes with // dynamicByteSource types used in procfs. +// +// +stateify savable type dynamicInode interface { kernfs.Inode vfs.DynamicBytesSource @@ -99,6 +102,7 @@ func (fs *filesystem) newDentry(creds *auth.Credentials, ino uint64, perm linux. return d } +// +stateify savable type staticFile struct { kernfs.DynamicBytesFile vfs.StaticData @@ -118,10 +122,13 @@ func newStaticDir(creds *auth.Credentials, devMajor, devMinor uint32, ino uint64 // InternalData contains internal data passed in to the procfs mount via // vfs.GetFilesystemOptions.InternalData. +// +// +stateify savable type InternalData struct { Cgroups map[string]string } +// +stateify savable type implStatFS struct{} // StatFS implements kernfs.Inode.StatFS. diff --git a/pkg/sentry/fsimpl/proc/proc_state_autogen.go b/pkg/sentry/fsimpl/proc/proc_state_autogen.go index 60a5644f3..3eea5708c 100644 --- a/pkg/sentry/fsimpl/proc/proc_state_autogen.go +++ b/pkg/sentry/fsimpl/proc/proc_state_autogen.go @@ -71,6 +71,100 @@ func (x *FilesystemType) afterLoad() {} func (x *FilesystemType) StateLoad(m state.Source) { } +func (x *filesystem) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.filesystem" +} + +func (x *filesystem) StateFields() []string { + return []string{ + "Filesystem", + "devMinor", + } +} + +func (x *filesystem) beforeSave() {} + +func (x *filesystem) StateSave(m state.Sink) { + x.beforeSave() + m.Save(0, &x.Filesystem) + m.Save(1, &x.devMinor) +} + +func (x *filesystem) afterLoad() {} + +func (x *filesystem) StateLoad(m state.Source) { + m.Load(0, &x.Filesystem) + m.Load(1, &x.devMinor) +} + +func (x *staticFile) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.staticFile" +} + +func (x *staticFile) StateFields() []string { + return []string{ + "DynamicBytesFile", + "StaticData", + } +} + +func (x *staticFile) beforeSave() {} + +func (x *staticFile) StateSave(m state.Sink) { + x.beforeSave() + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.StaticData) +} + +func (x *staticFile) afterLoad() {} + +func (x *staticFile) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.Load(1, &x.StaticData) +} + +func (x *InternalData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.InternalData" +} + +func (x *InternalData) StateFields() []string { + return []string{ + "Cgroups", + } +} + +func (x *InternalData) beforeSave() {} + +func (x *InternalData) StateSave(m state.Sink) { + x.beforeSave() + m.Save(0, &x.Cgroups) +} + +func (x *InternalData) afterLoad() {} + +func (x *InternalData) StateLoad(m state.Source) { + m.Load(0, &x.Cgroups) +} + +func (x *implStatFS) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.implStatFS" +} + +func (x *implStatFS) StateFields() []string { + return []string{} +} + +func (x *implStatFS) beforeSave() {} + +func (x *implStatFS) StateSave(m state.Sink) { + x.beforeSave() +} + +func (x *implStatFS) afterLoad() {} + +func (x *implStatFS) StateLoad(m state.Source) { +} + func (x *subtasksInode) StateTypeName() string { return "pkg/sentry/fsimpl/proc.subtasksInode" } @@ -127,6 +221,32 @@ func (x *subtasksInode) StateLoad(m state.Source) { m.Load(11, &x.cgroupControllers) } +func (x *subtasksFD) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.subtasksFD" +} + +func (x *subtasksFD) StateFields() []string { + return []string{ + "GenericDirectoryFD", + "task", + } +} + +func (x *subtasksFD) beforeSave() {} + +func (x *subtasksFD) StateSave(m state.Sink) { + x.beforeSave() + m.Save(0, &x.GenericDirectoryFD) + m.Save(1, &x.task) +} + +func (x *subtasksFD) afterLoad() {} + +func (x *subtasksFD) StateLoad(m state.Source) { + m.Load(0, &x.GenericDirectoryFD) + m.Load(1, &x.task) +} + func (x *subtasksInodeRefs) StateTypeName() string { return "pkg/sentry/fsimpl/proc.subtasksInodeRefs" } @@ -197,6 +317,64 @@ func (x *taskInode) StateLoad(m state.Source) { m.Load(8, &x.task) } +func (x *taskOwnedInode) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.taskOwnedInode" +} + +func (x *taskOwnedInode) StateFields() []string { + return []string{ + "Inode", + "owner", + } +} + +func (x *taskOwnedInode) beforeSave() {} + +func (x *taskOwnedInode) StateSave(m state.Sink) { + x.beforeSave() + m.Save(0, &x.Inode) + m.Save(1, &x.owner) +} + +func (x *taskOwnedInode) afterLoad() {} + +func (x *taskOwnedInode) StateLoad(m state.Source) { + m.Load(0, &x.Inode) + m.Load(1, &x.owner) +} + +func (x *fdDir) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.fdDir" +} + +func (x *fdDir) StateFields() []string { + return []string{ + "locks", + "fs", + "task", + "produceSymlink", + } +} + +func (x *fdDir) beforeSave() {} + +func (x *fdDir) StateSave(m state.Sink) { + x.beforeSave() + m.Save(0, &x.locks) + m.Save(1, &x.fs) + m.Save(2, &x.task) + m.Save(3, &x.produceSymlink) +} + +func (x *fdDir) afterLoad() {} + +func (x *fdDir) StateLoad(m state.Source) { + m.Load(0, &x.locks) + m.Load(1, &x.fs) + m.Load(2, &x.task) + m.Load(3, &x.produceSymlink) +} + func (x *fdDirInode) StateTypeName() string { return "pkg/sentry/fsimpl/proc.fdDirInode" } @@ -766,6 +944,102 @@ func (x *mountsData) StateLoad(m state.Source) { m.Load(1, &x.task) } +func (x *namespaceSymlink) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.namespaceSymlink" +} + +func (x *namespaceSymlink) StateFields() []string { + return []string{ + "StaticSymlink", + "task", + } +} + +func (x *namespaceSymlink) beforeSave() {} + +func (x *namespaceSymlink) StateSave(m state.Sink) { + x.beforeSave() + m.Save(0, &x.StaticSymlink) + m.Save(1, &x.task) +} + +func (x *namespaceSymlink) afterLoad() {} + +func (x *namespaceSymlink) StateLoad(m state.Source) { + m.Load(0, &x.StaticSymlink) + m.Load(1, &x.task) +} + +func (x *namespaceInode) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.namespaceInode" +} + +func (x *namespaceInode) StateFields() []string { + return []string{ + "implStatFS", + "InodeAttrs", + "InodeNoopRefCount", + "InodeNotDirectory", + "InodeNotSymlink", + "locks", + } +} + +func (x *namespaceInode) beforeSave() {} + +func (x *namespaceInode) StateSave(m state.Sink) { + x.beforeSave() + m.Save(0, &x.implStatFS) + m.Save(1, &x.InodeAttrs) + m.Save(2, &x.InodeNoopRefCount) + m.Save(3, &x.InodeNotDirectory) + m.Save(4, &x.InodeNotSymlink) + m.Save(5, &x.locks) +} + +func (x *namespaceInode) afterLoad() {} + +func (x *namespaceInode) StateLoad(m state.Source) { + m.Load(0, &x.implStatFS) + m.Load(1, &x.InodeAttrs) + m.Load(2, &x.InodeNoopRefCount) + m.Load(3, &x.InodeNotDirectory) + m.Load(4, &x.InodeNotSymlink) + m.Load(5, &x.locks) +} + +func (x *namespaceFD) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.namespaceFD" +} + +func (x *namespaceFD) StateFields() []string { + return []string{ + "FileDescriptionDefaultImpl", + "LockFD", + "vfsfd", + "inode", + } +} + +func (x *namespaceFD) beforeSave() {} + +func (x *namespaceFD) StateSave(m state.Sink) { + x.beforeSave() + m.Save(0, &x.FileDescriptionDefaultImpl) + m.Save(1, &x.LockFD) + m.Save(2, &x.vfsfd) + m.Save(3, &x.inode) +} + +func (x *namespaceFD) afterLoad() {} + +func (x *namespaceFD) StateLoad(m state.Source) { + m.Load(0, &x.FileDescriptionDefaultImpl) + m.Load(1, &x.LockFD) + m.Load(2, &x.vfsfd) + m.Load(3, &x.inode) +} + func (x *taskInodeRefs) StateTypeName() string { return "pkg/sentry/fsimpl/proc.taskInodeRefs" } @@ -971,6 +1245,32 @@ func (x *netSnmpData) StateLoad(m state.Source) { m.Load(1, &x.stack) } +func (x *snmpLine) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.snmpLine" +} + +func (x *snmpLine) StateFields() []string { + return []string{ + "prefix", + "header", + } +} + +func (x *snmpLine) beforeSave() {} + +func (x *snmpLine) StateSave(m state.Sink) { + x.beforeSave() + m.Save(0, &x.prefix) + m.Save(1, &x.header) +} + +func (x *snmpLine) afterLoad() {} + +func (x *snmpLine) StateLoad(m state.Source) { + m.Load(0, &x.prefix) + m.Load(1, &x.header) +} + func (x *netRouteData) StateTypeName() string { return "pkg/sentry/fsimpl/proc.netRouteData" } @@ -1082,6 +1382,175 @@ func (x *tasksInode) StateLoad(m state.Source) { m.Load(12, &x.cgroupControllers) } +func (x *staticFileSetStat) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.staticFileSetStat" +} + +func (x *staticFileSetStat) StateFields() []string { + return []string{ + "dynamicBytesFileSetAttr", + "StaticData", + } +} + +func (x *staticFileSetStat) beforeSave() {} + +func (x *staticFileSetStat) StateSave(m state.Sink) { + x.beforeSave() + m.Save(0, &x.dynamicBytesFileSetAttr) + m.Save(1, &x.StaticData) +} + +func (x *staticFileSetStat) afterLoad() {} + +func (x *staticFileSetStat) StateLoad(m state.Source) { + m.Load(0, &x.dynamicBytesFileSetAttr) + m.Load(1, &x.StaticData) +} + +func (x *selfSymlink) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.selfSymlink" +} + +func (x *selfSymlink) StateFields() []string { + return []string{ + "implStatFS", + "InodeAttrs", + "InodeNoopRefCount", + "InodeSymlink", + "pidns", + } +} + +func (x *selfSymlink) beforeSave() {} + +func (x *selfSymlink) StateSave(m state.Sink) { + x.beforeSave() + m.Save(0, &x.implStatFS) + m.Save(1, &x.InodeAttrs) + m.Save(2, &x.InodeNoopRefCount) + m.Save(3, &x.InodeSymlink) + m.Save(4, &x.pidns) +} + +func (x *selfSymlink) afterLoad() {} + +func (x *selfSymlink) StateLoad(m state.Source) { + m.Load(0, &x.implStatFS) + m.Load(1, &x.InodeAttrs) + m.Load(2, &x.InodeNoopRefCount) + m.Load(3, &x.InodeSymlink) + m.Load(4, &x.pidns) +} + +func (x *threadSelfSymlink) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.threadSelfSymlink" +} + +func (x *threadSelfSymlink) StateFields() []string { + return []string{ + "implStatFS", + "InodeAttrs", + "InodeNoopRefCount", + "InodeSymlink", + "pidns", + } +} + +func (x *threadSelfSymlink) beforeSave() {} + +func (x *threadSelfSymlink) StateSave(m state.Sink) { + x.beforeSave() + m.Save(0, &x.implStatFS) + m.Save(1, &x.InodeAttrs) + m.Save(2, &x.InodeNoopRefCount) + m.Save(3, &x.InodeSymlink) + m.Save(4, &x.pidns) +} + +func (x *threadSelfSymlink) afterLoad() {} + +func (x *threadSelfSymlink) StateLoad(m state.Source) { + m.Load(0, &x.implStatFS) + m.Load(1, &x.InodeAttrs) + m.Load(2, &x.InodeNoopRefCount) + m.Load(3, &x.InodeSymlink) + m.Load(4, &x.pidns) +} + +func (x *dynamicBytesFileSetAttr) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.dynamicBytesFileSetAttr" +} + +func (x *dynamicBytesFileSetAttr) StateFields() []string { + return []string{ + "DynamicBytesFile", + } +} + +func (x *dynamicBytesFileSetAttr) beforeSave() {} + +func (x *dynamicBytesFileSetAttr) StateSave(m state.Sink) { + x.beforeSave() + m.Save(0, &x.DynamicBytesFile) +} + +func (x *dynamicBytesFileSetAttr) afterLoad() {} + +func (x *dynamicBytesFileSetAttr) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) +} + +func (x *cpuStats) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.cpuStats" +} + +func (x *cpuStats) StateFields() []string { + return []string{ + "user", + "nice", + "system", + "idle", + "ioWait", + "irq", + "softirq", + "steal", + "guest", + "guestNice", + } +} + +func (x *cpuStats) beforeSave() {} + +func (x *cpuStats) StateSave(m state.Sink) { + x.beforeSave() + m.Save(0, &x.user) + m.Save(1, &x.nice) + m.Save(2, &x.system) + m.Save(3, &x.idle) + m.Save(4, &x.ioWait) + m.Save(5, &x.irq) + m.Save(6, &x.softirq) + m.Save(7, &x.steal) + m.Save(8, &x.guest) + m.Save(9, &x.guestNice) +} + +func (x *cpuStats) afterLoad() {} + +func (x *cpuStats) StateLoad(m state.Source) { + m.Load(0, &x.user) + m.Load(1, &x.nice) + m.Load(2, &x.system) + m.Load(3, &x.idle) + m.Load(4, &x.ioWait) + m.Load(5, &x.irq) + m.Load(6, &x.softirq) + m.Load(7, &x.steal) + m.Load(8, &x.guest) + m.Load(9, &x.guestNice) +} + func (x *statData) StateTypeName() string { return "pkg/sentry/fsimpl/proc.statData" } @@ -1243,6 +1712,14 @@ func (x *tasksInodeRefs) StateLoad(m state.Source) { m.Load(0, &x.refCount) } +func (x *tcpMemDir) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.tcpMemDir" +} + +func (x *tcpMemDir) StateFields() []string { + return nil +} + func (x *mmapMinAddrData) StateTypeName() string { return "pkg/sentry/fsimpl/proc.mmapMinAddrData" } @@ -1409,9 +1886,16 @@ func init() { state.Register((*fdDirInodeRefs)(nil)) state.Register((*fdInfoDirInodeRefs)(nil)) state.Register((*FilesystemType)(nil)) + state.Register((*filesystem)(nil)) + state.Register((*staticFile)(nil)) + state.Register((*InternalData)(nil)) + state.Register((*implStatFS)(nil)) state.Register((*subtasksInode)(nil)) + state.Register((*subtasksFD)(nil)) state.Register((*subtasksInodeRefs)(nil)) state.Register((*taskInode)(nil)) + state.Register((*taskOwnedInode)(nil)) + state.Register((*fdDir)(nil)) state.Register((*fdDirInode)(nil)) state.Register((*fdSymlink)(nil)) state.Register((*fdInfoDirInode)(nil)) @@ -1431,6 +1915,9 @@ func init() { state.Register((*exeSymlink)(nil)) state.Register((*mountInfoData)(nil)) state.Register((*mountsData)(nil)) + state.Register((*namespaceSymlink)(nil)) + state.Register((*namespaceInode)(nil)) + state.Register((*namespaceFD)(nil)) state.Register((*taskInodeRefs)(nil)) state.Register((*ifinet6)(nil)) state.Register((*netDevData)(nil)) @@ -1439,9 +1926,15 @@ func init() { state.Register((*netTCP6Data)(nil)) state.Register((*netUDPData)(nil)) state.Register((*netSnmpData)(nil)) + state.Register((*snmpLine)(nil)) state.Register((*netRouteData)(nil)) state.Register((*netStatData)(nil)) state.Register((*tasksInode)(nil)) + state.Register((*staticFileSetStat)(nil)) + state.Register((*selfSymlink)(nil)) + state.Register((*threadSelfSymlink)(nil)) + state.Register((*dynamicBytesFileSetAttr)(nil)) + state.Register((*cpuStats)(nil)) state.Register((*statData)(nil)) state.Register((*loadavgData)(nil)) state.Register((*meminfoData)(nil)) @@ -1449,6 +1942,7 @@ func init() { state.Register((*versionData)(nil)) state.Register((*filesystemsData)(nil)) state.Register((*tasksInodeRefs)(nil)) + state.Register((*tcpMemDir)(nil)) state.Register((*mmapMinAddrData)(nil)) state.Register((*hostnameData)(nil)) state.Register((*tcpSackData)(nil)) diff --git a/pkg/sentry/fsimpl/proc/subtasks.go b/pkg/sentry/fsimpl/proc/subtasks.go index 47dc0ac9a..47ecd941c 100644 --- a/pkg/sentry/fsimpl/proc/subtasks.go +++ b/pkg/sentry/fsimpl/proc/subtasks.go @@ -116,6 +116,7 @@ func (i *subtasksInode) IterDirents(ctx context.Context, cb vfs.IterDirentsCallb return offset, nil } +// +stateify savable type subtasksFD struct { kernfs.GenericDirectoryFD diff --git a/pkg/sentry/fsimpl/proc/task.go b/pkg/sentry/fsimpl/proc/task.go index ae461bb48..1f99183eb 100644 --- a/pkg/sentry/fsimpl/proc/task.go +++ b/pkg/sentry/fsimpl/proc/task.go @@ -129,6 +129,8 @@ func (i *taskInode) DecRef(context.Context) { // taskOwnedInode implements kernfs.Inode and overrides inode owner with task // effective user and group. +// +// +stateify savable type taskOwnedInode struct { kernfs.Inode diff --git a/pkg/sentry/fsimpl/proc/task_fds.go b/pkg/sentry/fsimpl/proc/task_fds.go index c7104458f..0866cea2b 100644 --- a/pkg/sentry/fsimpl/proc/task_fds.go +++ b/pkg/sentry/fsimpl/proc/task_fds.go @@ -51,6 +51,7 @@ func taskFDExists(ctx context.Context, t *kernel.Task, fd int32) bool { return true } +// +stateify savable type fdDir struct { locks vfs.FileLocks diff --git a/pkg/sentry/fsimpl/proc/task_files.go b/pkg/sentry/fsimpl/proc/task_files.go index feed5bc3f..b81c8279e 100644 --- a/pkg/sentry/fsimpl/proc/task_files.go +++ b/pkg/sentry/fsimpl/proc/task_files.go @@ -785,6 +785,7 @@ func (i *mountsData) Generate(ctx context.Context, buf *bytes.Buffer) error { return nil } +// +stateify savable type namespaceSymlink struct { kernfs.StaticSymlink @@ -832,6 +833,8 @@ func (s *namespaceSymlink) Getlink(ctx context.Context, mnt *vfs.Mount) (vfs.Vir // namespaceInode is a synthetic inode created to represent a namespace in // /proc/[pid]/ns/*. +// +// +stateify savable type namespaceInode struct { implStatFS kernfs.InodeAttrs @@ -865,6 +868,8 @@ func (i *namespaceInode) Open(ctx context.Context, rp *vfs.ResolvingPath, d *ker // namespace FD is a synthetic file that represents a namespace in // /proc/[pid]/ns/*. +// +// +stateify savable type namespaceFD struct { vfs.FileDescriptionDefaultImpl vfs.LockFD diff --git a/pkg/sentry/fsimpl/proc/task_net.go b/pkg/sentry/fsimpl/proc/task_net.go index 1607eac19..e7f748655 100644 --- a/pkg/sentry/fsimpl/proc/task_net.go +++ b/pkg/sentry/fsimpl/proc/task_net.go @@ -616,6 +616,7 @@ type netSnmpData struct { var _ dynamicInode = (*netSnmpData)(nil) +// +stateify savable type snmpLine struct { prefix string header string diff --git a/pkg/sentry/fsimpl/proc/tasks.go b/pkg/sentry/fsimpl/proc/tasks.go index ad08c3626..d8f5dd509 100644 --- a/pkg/sentry/fsimpl/proc/tasks.go +++ b/pkg/sentry/fsimpl/proc/tasks.go @@ -236,6 +236,8 @@ func (i *tasksInode) DecRef(context.Context) { // staticFileSetStat implements a special static file that allows inode // attributes to be set. This is to support /proc files that are readonly, but // allow attributes to be set. +// +// +stateify savable type staticFileSetStat struct { dynamicBytesFileSetAttr vfs.StaticData diff --git a/pkg/sentry/fsimpl/proc/tasks_files.go b/pkg/sentry/fsimpl/proc/tasks_files.go index 459a8e52e..f268c59b0 100644 --- a/pkg/sentry/fsimpl/proc/tasks_files.go +++ b/pkg/sentry/fsimpl/proc/tasks_files.go @@ -31,6 +31,7 @@ import ( "gvisor.dev/gvisor/pkg/usermem" ) +// +stateify savable type selfSymlink struct { implStatFS kernfs.InodeAttrs @@ -74,6 +75,7 @@ func (*selfSymlink) SetStat(context.Context, *vfs.Filesystem, *auth.Credentials, return syserror.EPERM } +// +stateify savable type threadSelfSymlink struct { implStatFS kernfs.InodeAttrs @@ -121,6 +123,8 @@ func (*threadSelfSymlink) SetStat(context.Context, *vfs.Filesystem, *auth.Creden // dynamicBytesFileSetAttr implements a special file that allows inode // attributes to be set. This is to support /proc files that are readonly, but // allow attributes to be set. +// +// +stateify savable type dynamicBytesFileSetAttr struct { kernfs.DynamicBytesFile } @@ -131,6 +135,8 @@ func (d *dynamicBytesFileSetAttr) SetStat(ctx context.Context, fs *vfs.Filesyste } // cpuStats contains the breakdown of CPU time for /proc/stat. +// +// +stateify savable type cpuStats struct { // user is time spent in userspace tasks with non-positive niceness. user uint64 diff --git a/pkg/sentry/fsimpl/proc/tasks_sys.go b/pkg/sentry/fsimpl/proc/tasks_sys.go index a3ffbb15e..3312b0418 100644 --- a/pkg/sentry/fsimpl/proc/tasks_sys.go +++ b/pkg/sentry/fsimpl/proc/tasks_sys.go @@ -31,6 +31,7 @@ import ( "gvisor.dev/gvisor/pkg/usermem" ) +// +stateify savable type tcpMemDir int const ( |