diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-07-01 22:13:20 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-07-01 22:13:20 +0000 |
commit | 2c01b3de20cfdc23d1a4fa5e03aa55c2f8d64178 (patch) | |
tree | 036aa31dc8850c92c21ed0c5aba44819b3fa33ad /pkg/sentry/kernel/pipe | |
parent | 727c7ca1cdcf195c6688b330cd68ee12ec88196e (diff) | |
parent | 16b751b6c610ec2c5a913cb8a818e9239ee7da71 (diff) |
Merge release-20210628.0-19-g16b751b6c (automated)
Diffstat (limited to 'pkg/sentry/kernel/pipe')
-rw-r--r-- | pkg/sentry/kernel/pipe/pipe_unsafe.go | 2 | ||||
-rw-r--r-- | pkg/sentry/kernel/pipe/pipe_util.go | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/pkg/sentry/kernel/pipe/pipe_unsafe.go b/pkg/sentry/kernel/pipe/pipe_unsafe.go index dd60cba24..077c5d596 100644 --- a/pkg/sentry/kernel/pipe/pipe_unsafe.go +++ b/pkg/sentry/kernel/pipe/pipe_unsafe.go @@ -23,6 +23,8 @@ import ( // concurrent calls cannot deadlock. // // Preconditions: x != y. +// +checklocksacquire:x.mu +// +checklocksacquire:y.mu func lockTwoPipes(x, y *Pipe) { // Lock the two pipes in order of increasing address. if uintptr(unsafe.Pointer(x)) < uintptr(unsafe.Pointer(y)) { diff --git a/pkg/sentry/kernel/pipe/pipe_util.go b/pkg/sentry/kernel/pipe/pipe_util.go index 84f9f6234..c883a9014 100644 --- a/pkg/sentry/kernel/pipe/pipe_util.go +++ b/pkg/sentry/kernel/pipe/pipe_util.go @@ -157,6 +157,7 @@ func (p *Pipe) Ioctl(ctx context.Context, io usermem.IO, args arch.SyscallArgume // // mu must be held by the caller. waitFor returns with mu held, but it will // drop mu before blocking for any reader/writers. +// +checklocks:mu func waitFor(mu *sync.Mutex, wakeupChan *chan struct{}, sleeper amutex.Sleeper) bool { // Ideally this function would simply use a condition variable. However, the // wait needs to be interruptible via 'sleeper', so we must sychronize via a |