diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-03-12 01:06:00 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-03-12 01:06:00 +0000 |
commit | 8a7964657411d80c685128531099d6c246216f12 (patch) | |
tree | 43a12cad4774774951da1548519e59ecff0050ae /pkg/sentry/fsimpl/fuse | |
parent | 3bbc07ece91af55682430e6ae2a30060f5f7fd9c (diff) | |
parent | c5667022b6617d732e0c0bcb8ca3b58d588ceafb (diff) |
Merge release-20210301.0-37-gc5667022b (automated)
Diffstat (limited to 'pkg/sentry/fsimpl/fuse')
-rw-r--r-- | pkg/sentry/fsimpl/fuse/fuse_state_autogen.go | 23 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/fuse/fusefs.go | 10 |
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 |