summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/fuse
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/sentry/fsimpl/fuse')
-rw-r--r--pkg/sentry/fsimpl/fuse/fuse_state_autogen.go23
-rw-r--r--pkg/sentry/fsimpl/fuse/fusefs.go10
2 files changed, 22 insertions, 11 deletions
diff --git a/pkg/sentry/fsimpl/fuse/fuse_state_autogen.go b/pkg/sentry/fsimpl/fuse/fuse_state_autogen.go
index f59e82755..0a75d80a5 100644
--- a/pkg/sentry/fsimpl/fuse/fuse_state_autogen.go
+++ b/pkg/sentry/fsimpl/fuse/fuse_state_autogen.go
@@ -200,6 +200,7 @@ func (f *filesystemOptions) StateTypeName() string {
func (f *filesystemOptions) StateFields() []string {
return []string{
+ "mopts",
"userID",
"groupID",
"rootMode",
@@ -212,21 +213,23 @@ func (f *filesystemOptions) beforeSave() {}
func (f *filesystemOptions) StateSave(stateSinkObject state.Sink) {
f.beforeSave()
- stateSinkObject.Save(0, &f.userID)
- stateSinkObject.Save(1, &f.groupID)
- stateSinkObject.Save(2, &f.rootMode)
- stateSinkObject.Save(3, &f.maxActiveRequests)
- stateSinkObject.Save(4, &f.maxRead)
+ stateSinkObject.Save(0, &f.mopts)
+ stateSinkObject.Save(1, &f.userID)
+ stateSinkObject.Save(2, &f.groupID)
+ stateSinkObject.Save(3, &f.rootMode)
+ stateSinkObject.Save(4, &f.maxActiveRequests)
+ stateSinkObject.Save(5, &f.maxRead)
}
func (f *filesystemOptions) afterLoad() {}
func (f *filesystemOptions) StateLoad(stateSourceObject state.Source) {
- stateSourceObject.Load(0, &f.userID)
- stateSourceObject.Load(1, &f.groupID)
- stateSourceObject.Load(2, &f.rootMode)
- stateSourceObject.Load(3, &f.maxActiveRequests)
- stateSourceObject.Load(4, &f.maxRead)
+ stateSourceObject.Load(0, &f.mopts)
+ stateSourceObject.Load(1, &f.userID)
+ stateSourceObject.Load(2, &f.groupID)
+ stateSourceObject.Load(3, &f.rootMode)
+ stateSourceObject.Load(4, &f.maxActiveRequests)
+ stateSourceObject.Load(5, &f.maxRead)
}
func (fs *filesystem) StateTypeName() string {
diff --git a/pkg/sentry/fsimpl/fuse/fusefs.go b/pkg/sentry/fsimpl/fuse/fusefs.go
index 204d8d143..fb0ba2c6d 100644
--- a/pkg/sentry/fsimpl/fuse/fusefs.go
+++ b/pkg/sentry/fsimpl/fuse/fusefs.go
@@ -47,6 +47,9 @@ type FilesystemType struct{}
// +stateify savable
type filesystemOptions struct {
+ // mopts contains the raw, unparsed mount options passed to this filesystem.
+ mopts string
+
// userID specifies the numeric uid of the mount owner.
// This option should not be specified by the filesystem owner.
// It is set by libfuse (or, if libfuse is not used, must be set
@@ -108,7 +111,7 @@ func (fsType FilesystemType) GetFilesystem(ctx context.Context, vfsObj *vfs.Virt
return nil, nil, err
}
- var fsopts filesystemOptions
+ fsopts := filesystemOptions{mopts: opts.Data}
mopts := vfs.GenericParseMountOptions(opts.Data)
deviceDescriptorStr, ok := mopts["fd"]
if !ok {
@@ -260,6 +263,11 @@ func (fs *filesystem) Release(ctx context.Context) {
fs.Filesystem.Release(ctx)
}
+// MountOptions implements vfs.FilesystemImpl.MountOptions.
+func (fs *filesystem) MountOptions() string {
+ return fs.opts.mopts
+}
+
// inode implements kernfs.Inode.
//
// +stateify savable