diff options
author | Dean Deng <deandeng@google.com> | 2020-10-13 01:11:00 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-10-13 01:13:22 -0700 |
commit | 577c82f22c6c175240fa52fee560f39aaa7db3a7 (patch) | |
tree | 9caece3c29217370e14e7c89de4a043e33df9a0f /pkg/sentry/fsimpl/verity | |
parent | fc7df53222e56fdce7dee002f1fb4c332de616af (diff) |
[vfs2] Add FilesystemType.Release to avoid reference leaks.
Singleton filesystem like devpts and devtmpfs have a single filesystem shared
among all mounts, so they acquire a "self-reference" when initialized that
must be released when the entire virtual filesystem is released at sandbox
exit.
PiperOrigin-RevId: 336828852
Diffstat (limited to 'pkg/sentry/fsimpl/verity')
-rw-r--r-- | pkg/sentry/fsimpl/verity/verity.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/sentry/fsimpl/verity/verity.go b/pkg/sentry/fsimpl/verity/verity.go index 4f11487a9..70034280b 100644 --- a/pkg/sentry/fsimpl/verity/verity.go +++ b/pkg/sentry/fsimpl/verity/verity.go @@ -156,6 +156,9 @@ func isEnabled(d *dentry) bool { return !d.fs.allowRuntimeEnable || len(d.hash) != 0 } +// Release implements vfs.FilesystemType.Release. +func (FilesystemType) Release(ctx context.Context) {} + // alertIntegrityViolation alerts a violation of integrity, which usually means // unexpected modification to the file system is detected. In // noCrashOnVerificationFailure mode, it returns an error, otherwise it panic. |