Fix data race in MountNamespace.resolve.

We must hold fs.renameMu to access Dirent.parent.

PiperOrigin-RevId: 290340804
This commit is contained in:
Nicolas Lacasse
2020-01-17 14:21:27 -08:00
committed by gVisor bot
parent 9073521098
commit f1a5178c58
+4 -1
View File
@@ -609,8 +609,11 @@ func (mns *MountNamespace) resolve(ctx context.Context, root, node *Dirent, rema
}
// Find the node; we resolve relative to the current symlink's parent.
renameMu.RLock()
parent := node.parent
renameMu.RUnlock()
*remainingTraversals--
d, err := mns.FindInode(ctx, root, node.parent, targetPath, remainingTraversals)
d, err := mns.FindInode(ctx, root, parent, targetPath, remainingTraversals)
if err != nil {
return nil, err
}