mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Fix data race caused by unlocked call of Dirent.descendantOf.
PiperOrigin-RevId: 224025363 Change-Id: I98864403c779832e9e1436f7d3c3f6fb2fba9904
This commit is contained in:
committed by
Shentubot
parent
c3dd68cea7
commit
54dd0d0dc5
@@ -840,6 +840,10 @@ func (d *Dirent) getDotAttrs(root *Dirent) (DentAttr, DentAttr) {
|
||||
InodeID: sattr.InodeID,
|
||||
}
|
||||
|
||||
// Hold d.mu while we call d.descendantOf.
|
||||
d.mu.Lock()
|
||||
defer d.mu.Unlock()
|
||||
|
||||
// Get '..'.
|
||||
if !d.IsRoot() && d.descendantOf(root) {
|
||||
// Dirent is a descendant of the root. Get its parent's attrs.
|
||||
|
||||
Reference in New Issue
Block a user