mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Don't read FSContext.root without holding FSContext.mu
IsChrooted still has the opportunity to race with another thread entering the FSContext into a chroot, but that is unchanged (and fine, AFAIK). PiperOrigin-RevId: 202029117 Change-Id: I38bce763b3a7715fa6ae98aa200a19d51a0235f1
This commit is contained in:
@@ -122,5 +122,7 @@ func (t *Task) AbstractSockets() *AbstractSocketNamespace {
|
||||
func (t *Task) IsChrooted() bool {
|
||||
realRoot := t.k.mounts.Root()
|
||||
defer realRoot.DecRef()
|
||||
return t.tr.FSContext.root != realRoot
|
||||
root := t.tr.FSContext.RootDirectory()
|
||||
defer root.DecRef()
|
||||
return root != realRoot
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user