From 432963dd2d9f4797f26a8b2555464a50f8319537 Mon Sep 17 00:00:00 2001 From: Dean Deng Date: Tue, 13 Oct 2020 11:29:21 -0700 Subject: [vfs2] Don't take reference in Task.MountNamespaceVFS2 and MountNamespace.Root. This fixes reference leaks related to accidentally forgetting to DecRef() after calling one or the other. PiperOrigin-RevId: 336918922 --- pkg/sentry/fsimpl/verity/verity_test.go | 1 + 1 file changed, 1 insertion(+) (limited to 'pkg/sentry/fsimpl/verity') diff --git a/pkg/sentry/fsimpl/verity/verity_test.go b/pkg/sentry/fsimpl/verity/verity_test.go index 8d0926bc4..e301d35f5 100644 --- a/pkg/sentry/fsimpl/verity/verity_test.go +++ b/pkg/sentry/fsimpl/verity/verity_test.go @@ -70,6 +70,7 @@ func newVerityRoot(ctx context.Context, t *testing.T) (*vfs.VirtualFilesystem, v return nil, vfs.VirtualDentry{}, fmt.Errorf("NewMountNamespace: %v", err) } root := mntns.Root() + root.IncRef() t.Helper() t.Cleanup(func() { root.DecRef(ctx) -- cgit v1.2.3