summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/kernfs/filesystem.go
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2019-12-23 17:31:20 -0800
committergVisor bot <gvisor-bot@google.com>2019-12-23 17:32:46 -0800
commit574e988f2bc6060078a17f37a377441703c52a22 (patch)
treec6742e6155cfcce99ada46b09800c30c7d79263e /pkg/sentry/fsimpl/kernfs/filesystem.go
parentf45df7505b0e7baf48a37f7c625f05051d144738 (diff)
Fix deadlock in kernfs.Filesystem.revalidateChildLocked
It was calling Dentry.InsertChild with the dentry's mutex already locked. Updates #1035 PiperOrigin-RevId: 286962742
Diffstat (limited to 'pkg/sentry/fsimpl/kernfs/filesystem.go')
-rw-r--r--pkg/sentry/fsimpl/kernfs/filesystem.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/sentry/fsimpl/kernfs/filesystem.go b/pkg/sentry/fsimpl/kernfs/filesystem.go
index a6f9fced5..79759e0fc 100644
--- a/pkg/sentry/fsimpl/kernfs/filesystem.go
+++ b/pkg/sentry/fsimpl/kernfs/filesystem.go
@@ -122,7 +122,7 @@ func (fs *Filesystem) revalidateChildLocked(ctx context.Context, vfsObj *vfs.Vir
return nil, err
}
// Reference on childVFSD dropped by a corresponding Valid.
- parent.InsertChild(name, childVFSD)
+ parent.insertChildLocked(name, childVFSD)
}
return childVFSD.Impl().(*Dentry), nil
}