diff options
author | Ayush Ranjan <ayushranjan@google.com> | 2021-10-26 11:56:09 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-10-26 11:59:21 -0700 |
commit | 763d7e6e396d8d4c67d650e02bd2350b22606ada (patch) | |
tree | 690226ef6653e159c485e0cf374560db9952be77 /pkg/sentry/vfs | |
parent | 8b2e8caad400fd3e7d3e4e235d26dd2d556bf65c (diff) |
Obtain ref on root dentry in mqfs.GetFilesystem.
As documented in FilesystemType.GetFilesystem, a reference should be taken on
the returned dentry and filesystem by GetFilesystem implementation. mqfs did
not do that.
Additionally cleanup and clarify ref counting of dentry, filesystem and mount
in mqfs.
Reported-by: syzbot+a2c54bfb6e1525228e5f@syzkaller.appspotmail.com
Reported-by: syzbot+ccd305cdab11cfebbfff@syzkaller.appspotmail.com
PiperOrigin-RevId: 405700565
Diffstat (limited to 'pkg/sentry/vfs')
-rw-r--r-- | pkg/sentry/vfs/filesystem_type.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/sentry/vfs/filesystem_type.go b/pkg/sentry/vfs/filesystem_type.go index 9d54cc4ed..70d6eb85e 100644 --- a/pkg/sentry/vfs/filesystem_type.go +++ b/pkg/sentry/vfs/filesystem_type.go @@ -28,7 +28,7 @@ import ( type FilesystemType interface { // GetFilesystem returns a Filesystem configured by the given options, // along with its mount root. A reference is taken on the returned - // Filesystem and Dentry. + // Filesystem and Dentry whose ownership is transferred to the caller. GetFilesystem(ctx context.Context, vfsObj *VirtualFilesystem, creds *auth.Credentials, source string, opts GetFilesystemOptions) (*Filesystem, *Dentry, error) // Name returns the name of this FilesystemType. |