We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e7ad5d8 commit d2303aeCopy full SHA for d2303ae
1 file changed
packages/orchestrator/pkg/sandbox/uffd/userfaultfd/userfaultfd.go
@@ -530,9 +530,10 @@ func (u *Userfaultfd) faultPage(
530
}
531
532
func (u *Userfaultfd) PrefetchData() block.PrefetchData {
533
- // This will be at worst cancelled when the uffd is closed.
+ // Hold Lock across the read — Lock; Unlock; Read leaves a window
534
+ // where a worker can RLock and mutate prefetchTracker before we read.
535
u.settleRequests.Lock()
- u.settleRequests.Unlock() //nolint:staticcheck // SA2001: intentional — we just need to settle the read locks.
536
+ defer u.settleRequests.Unlock()
537
538
return u.prefetchTracker.PrefetchData()
539
0 commit comments