summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/proc
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-08-28 21:35:00 +0000
committergVisor bot <gvisor-bot@google.com>2020-08-28 21:35:00 +0000
commit62daea73a85389e465e8b53a0dce9ac1f080e049 (patch)
tree1951814a20c0a868e3146dff0da000228f482785 /pkg/sentry/fsimpl/proc
parent91b955365d69946173b510f727d843103e8c79b6 (diff)
parentb4820e598681c61fbf0e8a7f4d3436d2599ce53c (diff)
Merge release-20200818.0-84-gb4820e598 (automated)
Diffstat (limited to 'pkg/sentry/fsimpl/proc')
-rw-r--r--pkg/sentry/fsimpl/proc/fd_dir_inode_refs.go2
-rw-r--r--pkg/sentry/fsimpl/proc/fd_info_dir_inode_refs.go2
-rw-r--r--pkg/sentry/fsimpl/proc/filesystem.go7
-rw-r--r--pkg/sentry/fsimpl/proc/proc_state_autogen.go263
-rw-r--r--pkg/sentry/fsimpl/proc/subtasks.go9
-rw-r--r--pkg/sentry/fsimpl/proc/subtasks_inode_refs.go2
-rw-r--r--pkg/sentry/fsimpl/proc/task.go7
-rw-r--r--pkg/sentry/fsimpl/proc/task_fds.go19
-rw-r--r--pkg/sentry/fsimpl/proc/task_files.go2
-rw-r--r--pkg/sentry/fsimpl/proc/task_inode_refs.go2
-rw-r--r--pkg/sentry/fsimpl/proc/tasks.go9
-rw-r--r--pkg/sentry/fsimpl/proc/tasks_files.go2
-rw-r--r--pkg/sentry/fsimpl/proc/tasks_inode_refs.go2
13 files changed, 183 insertions, 145 deletions
diff --git a/pkg/sentry/fsimpl/proc/fd_dir_inode_refs.go b/pkg/sentry/fsimpl/proc/fd_dir_inode_refs.go
index 8ed286c46..9431c1506 100644
--- a/pkg/sentry/fsimpl/proc/fd_dir_inode_refs.go
+++ b/pkg/sentry/fsimpl/proc/fd_dir_inode_refs.go
@@ -2,11 +2,11 @@ package proc
import (
"fmt"
- refs_vfs1 "gvisor.dev/gvisor/pkg/refs"
"runtime"
"sync/atomic"
"gvisor.dev/gvisor/pkg/log"
+ refs_vfs1 "gvisor.dev/gvisor/pkg/refs"
)
// ownerType is used to customize logging. Note that we use a pointer to T so
diff --git a/pkg/sentry/fsimpl/proc/fd_info_dir_inode_refs.go b/pkg/sentry/fsimpl/proc/fd_info_dir_inode_refs.go
index 957c6a6dd..872b20eb0 100644
--- a/pkg/sentry/fsimpl/proc/fd_info_dir_inode_refs.go
+++ b/pkg/sentry/fsimpl/proc/fd_info_dir_inode_refs.go
@@ -2,11 +2,11 @@ package proc
import (
"fmt"
- refs_vfs1 "gvisor.dev/gvisor/pkg/refs"
"runtime"
"sync/atomic"
"gvisor.dev/gvisor/pkg/log"
+ refs_vfs1 "gvisor.dev/gvisor/pkg/refs"
)
// ownerType is used to customize logging. Note that we use a pointer to T so
diff --git a/pkg/sentry/fsimpl/proc/filesystem.go b/pkg/sentry/fsimpl/proc/filesystem.go
index c350ec127..03b5941b9 100644
--- a/pkg/sentry/fsimpl/proc/filesystem.go
+++ b/pkg/sentry/fsimpl/proc/filesystem.go
@@ -121,3 +121,10 @@ func newStaticDir(creds *auth.Credentials, devMajor, devMinor uint32, ino uint64
type InternalData struct {
Cgroups map[string]string
}
+
+type implStatFS struct{}
+
+// StatFS implements kernfs.Inode.StatFS.
+func (*implStatFS) StatFS(context.Context, *vfs.Filesystem) (linux.Statfs, error) {
+ return vfs.GenericStatFS(linux.PROC_SUPER_MAGIC), nil
+}
diff --git a/pkg/sentry/fsimpl/proc/proc_state_autogen.go b/pkg/sentry/fsimpl/proc/proc_state_autogen.go
index 907ef38e0..1a13f066a 100644
--- a/pkg/sentry/fsimpl/proc/proc_state_autogen.go
+++ b/pkg/sentry/fsimpl/proc/proc_state_autogen.go
@@ -77,12 +77,13 @@ func (x *subtasksInode) StateTypeName() string {
func (x *subtasksInode) StateFields() []string {
return []string{
- "subtasksInodeRefs",
- "InodeNotSymlink",
- "InodeDirectoryNoNewChildren",
+ "implStatFS",
+ "AlwaysValid",
"InodeAttrs",
+ "InodeDirectoryNoNewChildren",
+ "InodeNotSymlink",
"OrderedChildren",
- "AlwaysValid",
+ "subtasksInodeRefs",
"locks",
"fs",
"task",
@@ -95,33 +96,35 @@ func (x *subtasksInode) beforeSave() {}
func (x *subtasksInode) StateSave(m state.Sink) {
x.beforeSave()
- m.Save(0, &x.subtasksInodeRefs)
- m.Save(1, &x.InodeNotSymlink)
- m.Save(2, &x.InodeDirectoryNoNewChildren)
- m.Save(3, &x.InodeAttrs)
- m.Save(4, &x.OrderedChildren)
- m.Save(5, &x.AlwaysValid)
- m.Save(6, &x.locks)
- m.Save(7, &x.fs)
- m.Save(8, &x.task)
- m.Save(9, &x.pidns)
- m.Save(10, &x.cgroupControllers)
+ m.Save(0, &x.implStatFS)
+ m.Save(1, &x.AlwaysValid)
+ m.Save(2, &x.InodeAttrs)
+ m.Save(3, &x.InodeDirectoryNoNewChildren)
+ m.Save(4, &x.InodeNotSymlink)
+ m.Save(5, &x.OrderedChildren)
+ m.Save(6, &x.subtasksInodeRefs)
+ m.Save(7, &x.locks)
+ m.Save(8, &x.fs)
+ m.Save(9, &x.task)
+ m.Save(10, &x.pidns)
+ m.Save(11, &x.cgroupControllers)
}
func (x *subtasksInode) afterLoad() {}
func (x *subtasksInode) StateLoad(m state.Source) {
- m.Load(0, &x.subtasksInodeRefs)
- m.Load(1, &x.InodeNotSymlink)
- m.Load(2, &x.InodeDirectoryNoNewChildren)
- m.Load(3, &x.InodeAttrs)
- m.Load(4, &x.OrderedChildren)
- m.Load(5, &x.AlwaysValid)
- m.Load(6, &x.locks)
- m.Load(7, &x.fs)
- m.Load(8, &x.task)
- m.Load(9, &x.pidns)
- m.Load(10, &x.cgroupControllers)
+ m.Load(0, &x.implStatFS)
+ m.Load(1, &x.AlwaysValid)
+ m.Load(2, &x.InodeAttrs)
+ m.Load(3, &x.InodeDirectoryNoNewChildren)
+ m.Load(4, &x.InodeNotSymlink)
+ m.Load(5, &x.OrderedChildren)
+ m.Load(6, &x.subtasksInodeRefs)
+ m.Load(7, &x.locks)
+ m.Load(8, &x.fs)
+ m.Load(9, &x.task)
+ m.Load(10, &x.pidns)
+ m.Load(11, &x.cgroupControllers)
}
func (x *subtasksInodeRefs) StateTypeName() string {
@@ -153,12 +156,13 @@ func (x *taskInode) StateTypeName() string {
func (x *taskInode) StateFields() []string {
return []string{
- "taskInodeRefs",
- "InodeNotSymlink",
+ "implStatFS",
+ "InodeAttrs",
"InodeDirectoryNoNewChildren",
"InodeNoDynamicLookup",
- "InodeAttrs",
+ "InodeNotSymlink",
"OrderedChildren",
+ "taskInodeRefs",
"locks",
"task",
}
@@ -168,27 +172,29 @@ func (x *taskInode) beforeSave() {}
func (x *taskInode) StateSave(m state.Sink) {
x.beforeSave()
- m.Save(0, &x.taskInodeRefs)
- m.Save(1, &x.InodeNotSymlink)
+ m.Save(0, &x.implStatFS)
+ m.Save(1, &x.InodeAttrs)
m.Save(2, &x.InodeDirectoryNoNewChildren)
m.Save(3, &x.InodeNoDynamicLookup)
- m.Save(4, &x.InodeAttrs)
+ m.Save(4, &x.InodeNotSymlink)
m.Save(5, &x.OrderedChildren)
- m.Save(6, &x.locks)
- m.Save(7, &x.task)
+ m.Save(6, &x.taskInodeRefs)
+ m.Save(7, &x.locks)
+ m.Save(8, &x.task)
}
func (x *taskInode) afterLoad() {}
func (x *taskInode) StateLoad(m state.Source) {
- m.Load(0, &x.taskInodeRefs)
- m.Load(1, &x.InodeNotSymlink)
+ m.Load(0, &x.implStatFS)
+ m.Load(1, &x.InodeAttrs)
m.Load(2, &x.InodeDirectoryNoNewChildren)
m.Load(3, &x.InodeNoDynamicLookup)
- m.Load(4, &x.InodeAttrs)
+ m.Load(4, &x.InodeNotSymlink)
m.Load(5, &x.OrderedChildren)
- m.Load(6, &x.locks)
- m.Load(7, &x.task)
+ m.Load(6, &x.taskInodeRefs)
+ m.Load(7, &x.locks)
+ m.Load(8, &x.task)
}
func (x *fdDirInode) StateTypeName() string {
@@ -197,13 +203,14 @@ func (x *fdDirInode) StateTypeName() string {
func (x *fdDirInode) StateFields() []string {
return []string{
+ "fdDir",
"fdDirInodeRefs",
- "InodeNotSymlink",
- "InodeDirectoryNoNewChildren",
+ "implStatFS",
+ "AlwaysValid",
"InodeAttrs",
+ "InodeDirectoryNoNewChildren",
+ "InodeNotSymlink",
"OrderedChildren",
- "AlwaysValid",
- "fdDir",
}
}
@@ -211,25 +218,27 @@ func (x *fdDirInode) beforeSave() {}
func (x *fdDirInode) StateSave(m state.Sink) {
x.beforeSave()
- m.Save(0, &x.fdDirInodeRefs)
- m.Save(1, &x.InodeNotSymlink)
- m.Save(2, &x.InodeDirectoryNoNewChildren)
- m.Save(3, &x.InodeAttrs)
- m.Save(4, &x.OrderedChildren)
- m.Save(5, &x.AlwaysValid)
- m.Save(6, &x.fdDir)
+ m.Save(0, &x.fdDir)
+ m.Save(1, &x.fdDirInodeRefs)
+ m.Save(2, &x.implStatFS)
+ m.Save(3, &x.AlwaysValid)
+ m.Save(4, &x.InodeAttrs)
+ m.Save(5, &x.InodeDirectoryNoNewChildren)
+ m.Save(6, &x.InodeNotSymlink)
+ m.Save(7, &x.OrderedChildren)
}
func (x *fdDirInode) afterLoad() {}
func (x *fdDirInode) StateLoad(m state.Source) {
- m.Load(0, &x.fdDirInodeRefs)
- m.Load(1, &x.InodeNotSymlink)
- m.Load(2, &x.InodeDirectoryNoNewChildren)
- m.Load(3, &x.InodeAttrs)
- m.Load(4, &x.OrderedChildren)
- m.Load(5, &x.AlwaysValid)
- m.Load(6, &x.fdDir)
+ m.Load(0, &x.fdDir)
+ m.Load(1, &x.fdDirInodeRefs)
+ m.Load(2, &x.implStatFS)
+ m.Load(3, &x.AlwaysValid)
+ m.Load(4, &x.InodeAttrs)
+ m.Load(5, &x.InodeDirectoryNoNewChildren)
+ m.Load(6, &x.InodeNotSymlink)
+ m.Load(7, &x.OrderedChildren)
}
func (x *fdSymlink) StateTypeName() string {
@@ -238,6 +247,7 @@ func (x *fdSymlink) StateTypeName() string {
func (x *fdSymlink) StateFields() []string {
return []string{
+ "implStatFS",
"InodeAttrs",
"InodeNoopRefCount",
"InodeSymlink",
@@ -250,21 +260,23 @@ func (x *fdSymlink) beforeSave() {}
func (x *fdSymlink) StateSave(m state.Sink) {
x.beforeSave()
- m.Save(0, &x.InodeAttrs)
- m.Save(1, &x.InodeNoopRefCount)
- m.Save(2, &x.InodeSymlink)
- m.Save(3, &x.task)
- m.Save(4, &x.fd)
+ m.Save(0, &x.implStatFS)
+ m.Save(1, &x.InodeAttrs)
+ m.Save(2, &x.InodeNoopRefCount)
+ m.Save(3, &x.InodeSymlink)
+ m.Save(4, &x.task)
+ m.Save(5, &x.fd)
}
func (x *fdSymlink) afterLoad() {}
func (x *fdSymlink) StateLoad(m state.Source) {
- m.Load(0, &x.InodeAttrs)
- m.Load(1, &x.InodeNoopRefCount)
- m.Load(2, &x.InodeSymlink)
- m.Load(3, &x.task)
- m.Load(4, &x.fd)
+ m.Load(0, &x.implStatFS)
+ m.Load(1, &x.InodeAttrs)
+ m.Load(2, &x.InodeNoopRefCount)
+ m.Load(3, &x.InodeSymlink)
+ m.Load(4, &x.task)
+ m.Load(5, &x.fd)
}
func (x *fdInfoDirInode) StateTypeName() string {
@@ -273,13 +285,14 @@ func (x *fdInfoDirInode) StateTypeName() string {
func (x *fdInfoDirInode) StateFields() []string {
return []string{
+ "fdDir",
"fdInfoDirInodeRefs",
- "InodeNotSymlink",
- "InodeDirectoryNoNewChildren",
+ "implStatFS",
+ "AlwaysValid",
"InodeAttrs",
+ "InodeDirectoryNoNewChildren",
+ "InodeNotSymlink",
"OrderedChildren",
- "AlwaysValid",
- "fdDir",
}
}
@@ -287,25 +300,27 @@ func (x *fdInfoDirInode) beforeSave() {}
func (x *fdInfoDirInode) StateSave(m state.Sink) {
x.beforeSave()
- m.Save(0, &x.fdInfoDirInodeRefs)
- m.Save(1, &x.InodeNotSymlink)
- m.Save(2, &x.InodeDirectoryNoNewChildren)
- m.Save(3, &x.InodeAttrs)
- m.Save(4, &x.OrderedChildren)
- m.Save(5, &x.AlwaysValid)
- m.Save(6, &x.fdDir)
+ m.Save(0, &x.fdDir)
+ m.Save(1, &x.fdInfoDirInodeRefs)
+ m.Save(2, &x.implStatFS)
+ m.Save(3, &x.AlwaysValid)
+ m.Save(4, &x.InodeAttrs)
+ m.Save(5, &x.InodeDirectoryNoNewChildren)
+ m.Save(6, &x.InodeNotSymlink)
+ m.Save(7, &x.OrderedChildren)
}
func (x *fdInfoDirInode) afterLoad() {}
func (x *fdInfoDirInode) StateLoad(m state.Source) {
- m.Load(0, &x.fdInfoDirInodeRefs)
- m.Load(1, &x.InodeNotSymlink)
- m.Load(2, &x.InodeDirectoryNoNewChildren)
- m.Load(3, &x.InodeAttrs)
- m.Load(4, &x.OrderedChildren)
- m.Load(5, &x.AlwaysValid)
- m.Load(6, &x.fdDir)
+ m.Load(0, &x.fdDir)
+ m.Load(1, &x.fdInfoDirInodeRefs)
+ m.Load(2, &x.implStatFS)
+ m.Load(3, &x.AlwaysValid)
+ m.Load(4, &x.InodeAttrs)
+ m.Load(5, &x.InodeDirectoryNoNewChildren)
+ m.Load(6, &x.InodeNotSymlink)
+ m.Load(7, &x.OrderedChildren)
}
func (x *fdInfoData) StateTypeName() string {
@@ -670,6 +685,7 @@ func (x *exeSymlink) StateTypeName() string {
func (x *exeSymlink) StateFields() []string {
return []string{
+ "implStatFS",
"InodeAttrs",
"InodeNoopRefCount",
"InodeSymlink",
@@ -681,19 +697,21 @@ func (x *exeSymlink) beforeSave() {}
func (x *exeSymlink) StateSave(m state.Sink) {
x.beforeSave()
- m.Save(0, &x.InodeAttrs)
- m.Save(1, &x.InodeNoopRefCount)
- m.Save(2, &x.InodeSymlink)
- m.Save(3, &x.task)
+ m.Save(0, &x.implStatFS)
+ m.Save(1, &x.InodeAttrs)
+ m.Save(2, &x.InodeNoopRefCount)
+ m.Save(3, &x.InodeSymlink)
+ m.Save(4, &x.task)
}
func (x *exeSymlink) afterLoad() {}
func (x *exeSymlink) StateLoad(m state.Source) {
- m.Load(0, &x.InodeAttrs)
- m.Load(1, &x.InodeNoopRefCount)
- m.Load(2, &x.InodeSymlink)
- m.Load(3, &x.task)
+ m.Load(0, &x.implStatFS)
+ m.Load(1, &x.InodeAttrs)
+ m.Load(2, &x.InodeNoopRefCount)
+ m.Load(3, &x.InodeSymlink)
+ m.Load(4, &x.task)
}
func (x *mountInfoData) StateTypeName() string {
@@ -1011,12 +1029,13 @@ func (x *tasksInode) StateTypeName() string {
func (x *tasksInode) StateFields() []string {
return []string{
- "tasksInodeRefs",
- "InodeNotSymlink",
- "InodeDirectoryNoNewChildren",
+ "implStatFS",
+ "AlwaysValid",
"InodeAttrs",
+ "InodeDirectoryNoNewChildren",
+ "InodeNotSymlink",
"OrderedChildren",
- "AlwaysValid",
+ "tasksInodeRefs",
"locks",
"fs",
"pidns",
@@ -1030,35 +1049,37 @@ func (x *tasksInode) beforeSave() {}
func (x *tasksInode) StateSave(m state.Sink) {
x.beforeSave()
- m.Save(0, &x.tasksInodeRefs)
- m.Save(1, &x.InodeNotSymlink)
- m.Save(2, &x.InodeDirectoryNoNewChildren)
- m.Save(3, &x.InodeAttrs)
- m.Save(4, &x.OrderedChildren)
- m.Save(5, &x.AlwaysValid)
- m.Save(6, &x.locks)
- m.Save(7, &x.fs)
- m.Save(8, &x.pidns)
- m.Save(9, &x.selfSymlink)
- m.Save(10, &x.threadSelfSymlink)
- m.Save(11, &x.cgroupControllers)
+ m.Save(0, &x.implStatFS)
+ m.Save(1, &x.AlwaysValid)
+ m.Save(2, &x.InodeAttrs)
+ m.Save(3, &x.InodeDirectoryNoNewChildren)
+ m.Save(4, &x.InodeNotSymlink)
+ m.Save(5, &x.OrderedChildren)
+ m.Save(6, &x.tasksInodeRefs)
+ m.Save(7, &x.locks)
+ m.Save(8, &x.fs)
+ m.Save(9, &x.pidns)
+ m.Save(10, &x.selfSymlink)
+ m.Save(11, &x.threadSelfSymlink)
+ m.Save(12, &x.cgroupControllers)
}
func (x *tasksInode) afterLoad() {}
func (x *tasksInode) StateLoad(m state.Source) {
- m.Load(0, &x.tasksInodeRefs)
- m.Load(1, &x.InodeNotSymlink)
- m.Load(2, &x.InodeDirectoryNoNewChildren)
- m.Load(3, &x.InodeAttrs)
- m.Load(4, &x.OrderedChildren)
- m.Load(5, &x.AlwaysValid)
- m.Load(6, &x.locks)
- m.Load(7, &x.fs)
- m.Load(8, &x.pidns)
- m.Load(9, &x.selfSymlink)
- m.Load(10, &x.threadSelfSymlink)
- m.Load(11, &x.cgroupControllers)
+ m.Load(0, &x.implStatFS)
+ m.Load(1, &x.AlwaysValid)
+ m.Load(2, &x.InodeAttrs)
+ m.Load(3, &x.InodeDirectoryNoNewChildren)
+ m.Load(4, &x.InodeNotSymlink)
+ m.Load(5, &x.OrderedChildren)
+ m.Load(6, &x.tasksInodeRefs)
+ m.Load(7, &x.locks)
+ m.Load(8, &x.fs)
+ m.Load(9, &x.pidns)
+ m.Load(10, &x.selfSymlink)
+ m.Load(11, &x.threadSelfSymlink)
+ m.Load(12, &x.cgroupControllers)
}
func (x *statData) StateTypeName() string {
diff --git a/pkg/sentry/fsimpl/proc/subtasks.go b/pkg/sentry/fsimpl/proc/subtasks.go
index 01c0efb3a..d57d94dbc 100644
--- a/pkg/sentry/fsimpl/proc/subtasks.go
+++ b/pkg/sentry/fsimpl/proc/subtasks.go
@@ -31,12 +31,13 @@ import (
//
// +stateify savable
type subtasksInode struct {
- subtasksInodeRefs
- kernfs.InodeNotSymlink
- kernfs.InodeDirectoryNoNewChildren
+ implStatFS
+ kernfs.AlwaysValid
kernfs.InodeAttrs
+ kernfs.InodeDirectoryNoNewChildren
+ kernfs.InodeNotSymlink
kernfs.OrderedChildren
- kernfs.AlwaysValid
+ subtasksInodeRefs
locks vfs.FileLocks
diff --git a/pkg/sentry/fsimpl/proc/subtasks_inode_refs.go b/pkg/sentry/fsimpl/proc/subtasks_inode_refs.go
index a80ec9e0a..c6d9b3522 100644
--- a/pkg/sentry/fsimpl/proc/subtasks_inode_refs.go
+++ b/pkg/sentry/fsimpl/proc/subtasks_inode_refs.go
@@ -2,11 +2,11 @@ package proc
import (
"fmt"
- refs_vfs1 "gvisor.dev/gvisor/pkg/refs"
"runtime"
"sync/atomic"
"gvisor.dev/gvisor/pkg/log"
+ refs_vfs1 "gvisor.dev/gvisor/pkg/refs"
)
// ownerType is used to customize logging. Note that we use a pointer to T so
diff --git a/pkg/sentry/fsimpl/proc/task.go b/pkg/sentry/fsimpl/proc/task.go
index 66b557abd..dbdb5d929 100644
--- a/pkg/sentry/fsimpl/proc/task.go
+++ b/pkg/sentry/fsimpl/proc/task.go
@@ -32,12 +32,13 @@ import (
//
// +stateify savable
type taskInode struct {
- taskInodeRefs
- kernfs.InodeNotSymlink
+ implStatFS
+ kernfs.InodeAttrs
kernfs.InodeDirectoryNoNewChildren
kernfs.InodeNoDynamicLookup
- kernfs.InodeAttrs
+ kernfs.InodeNotSymlink
kernfs.OrderedChildren
+ taskInodeRefs
locks vfs.FileLocks
diff --git a/pkg/sentry/fsimpl/proc/task_fds.go b/pkg/sentry/fsimpl/proc/task_fds.go
index 0527b2de8..3f0d78461 100644
--- a/pkg/sentry/fsimpl/proc/task_fds.go
+++ b/pkg/sentry/fsimpl/proc/task_fds.go
@@ -100,13 +100,14 @@ func (i *fdDir) IterDirents(ctx context.Context, cb vfs.IterDirentsCallback, off
//
// +stateify savable
type fdDirInode struct {
+ fdDir
fdDirInodeRefs
- kernfs.InodeNotSymlink
- kernfs.InodeDirectoryNoNewChildren
+ implStatFS
+ kernfs.AlwaysValid
kernfs.InodeAttrs
+ kernfs.InodeDirectoryNoNewChildren
+ kernfs.InodeNotSymlink
kernfs.OrderedChildren
- kernfs.AlwaysValid
- fdDir
}
var _ kernfs.Inode = (*fdDirInode)(nil)
@@ -185,6 +186,7 @@ func (i *fdDirInode) DecRef(context.Context) {
//
// +stateify savable
type fdSymlink struct {
+ implStatFS
kernfs.InodeAttrs
kernfs.InodeNoopRefCount
kernfs.InodeSymlink
@@ -233,13 +235,14 @@ func (s *fdSymlink) Getlink(ctx context.Context, mnt *vfs.Mount) (vfs.VirtualDen
//
// +stateify savable
type fdInfoDirInode struct {
+ fdDir
fdInfoDirInodeRefs
- kernfs.InodeNotSymlink
- kernfs.InodeDirectoryNoNewChildren
+ implStatFS
+ kernfs.AlwaysValid
kernfs.InodeAttrs
+ kernfs.InodeDirectoryNoNewChildren
+ kernfs.InodeNotSymlink
kernfs.OrderedChildren
- kernfs.AlwaysValid
- fdDir
}
var _ kernfs.Inode = (*fdInfoDirInode)(nil)
diff --git a/pkg/sentry/fsimpl/proc/task_files.go b/pkg/sentry/fsimpl/proc/task_files.go
index 830b78949..356036b9b 100644
--- a/pkg/sentry/fsimpl/proc/task_files.go
+++ b/pkg/sentry/fsimpl/proc/task_files.go
@@ -648,6 +648,7 @@ func (o *oomScoreAdj) Write(ctx context.Context, src usermem.IOSequence, offset
//
// +stateify savable
type exeSymlink struct {
+ implStatFS
kernfs.InodeAttrs
kernfs.InodeNoopRefCount
kernfs.InodeSymlink
@@ -832,6 +833,7 @@ 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/*.
type namespaceInode struct {
+ implStatFS
kernfs.InodeAttrs
kernfs.InodeNoopRefCount
kernfs.InodeNotDirectory
diff --git a/pkg/sentry/fsimpl/proc/task_inode_refs.go b/pkg/sentry/fsimpl/proc/task_inode_refs.go
index c4835cbca..714488450 100644
--- a/pkg/sentry/fsimpl/proc/task_inode_refs.go
+++ b/pkg/sentry/fsimpl/proc/task_inode_refs.go
@@ -2,11 +2,11 @@ package proc
import (
"fmt"
- refs_vfs1 "gvisor.dev/gvisor/pkg/refs"
"runtime"
"sync/atomic"
"gvisor.dev/gvisor/pkg/log"
+ refs_vfs1 "gvisor.dev/gvisor/pkg/refs"
)
// ownerType is used to customize logging. Note that we use a pointer to T so
diff --git a/pkg/sentry/fsimpl/proc/tasks.go b/pkg/sentry/fsimpl/proc/tasks.go
index 863c4467e..3ea00ab87 100644
--- a/pkg/sentry/fsimpl/proc/tasks.go
+++ b/pkg/sentry/fsimpl/proc/tasks.go
@@ -37,12 +37,13 @@ const (
//
// +stateify savable
type tasksInode struct {
- tasksInodeRefs
- kernfs.InodeNotSymlink
- kernfs.InodeDirectoryNoNewChildren
+ implStatFS
+ kernfs.AlwaysValid
kernfs.InodeAttrs
+ kernfs.InodeDirectoryNoNewChildren
+ kernfs.InodeNotSymlink
kernfs.OrderedChildren
- kernfs.AlwaysValid
+ tasksInodeRefs
locks vfs.FileLocks
diff --git a/pkg/sentry/fsimpl/proc/tasks_files.go b/pkg/sentry/fsimpl/proc/tasks_files.go
index 7d8983aa5..8c41729e4 100644
--- a/pkg/sentry/fsimpl/proc/tasks_files.go
+++ b/pkg/sentry/fsimpl/proc/tasks_files.go
@@ -32,6 +32,7 @@ import (
)
type selfSymlink struct {
+ implStatFS
kernfs.InodeAttrs
kernfs.InodeNoopRefCount
kernfs.InodeSymlink
@@ -74,6 +75,7 @@ func (*selfSymlink) SetStat(context.Context, *vfs.Filesystem, *auth.Credentials,
}
type threadSelfSymlink struct {
+ implStatFS
kernfs.InodeAttrs
kernfs.InodeNoopRefCount
kernfs.InodeSymlink
diff --git a/pkg/sentry/fsimpl/proc/tasks_inode_refs.go b/pkg/sentry/fsimpl/proc/tasks_inode_refs.go
index 5dfb34238..22d9cc488 100644
--- a/pkg/sentry/fsimpl/proc/tasks_inode_refs.go
+++ b/pkg/sentry/fsimpl/proc/tasks_inode_refs.go
@@ -2,11 +2,11 @@ package proc
import (
"fmt"
- refs_vfs1 "gvisor.dev/gvisor/pkg/refs"
"runtime"
"sync/atomic"
"gvisor.dev/gvisor/pkg/log"
+ refs_vfs1 "gvisor.dev/gvisor/pkg/refs"
)
// ownerType is used to customize logging. Note that we use a pointer to T so