diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-07-12 22:31:07 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-07-12 22:31:07 +0000 |
commit | cbf3251b8d2ea4b6ab3eff2bd6a4b2804a11706c (patch) | |
tree | 24b26c36e631a803a71bffeff8f0658247db0fc2 /pkg/sentry/kernel/semaphore | |
parent | f28c339def09aea90fe60b3abb38215c5e5c8e52 (diff) | |
parent | e3fdd1593217894328d5a917bbc356d0a7d145f0 (diff) |
Merge release-20210705.0-11-ge3fdd1593 (automated)
Diffstat (limited to 'pkg/sentry/kernel/semaphore')
-rw-r--r-- | pkg/sentry/kernel/semaphore/semaphore.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/pkg/sentry/kernel/semaphore/semaphore.go b/pkg/sentry/kernel/semaphore/semaphore.go index 067cc75c1..485c3a788 100644 --- a/pkg/sentry/kernel/semaphore/semaphore.go +++ b/pkg/sentry/kernel/semaphore/semaphore.go @@ -151,7 +151,7 @@ func (r *Registry) FindOrCreate(ctx context.Context, key, nsems int32, mode linu return nil, linuxerr.EINVAL } if create && exclusive { - return nil, syserror.EEXIST + return nil, linuxerr.EEXIST } return set, nil } @@ -418,7 +418,7 @@ func (s *Set) semStat(creds *auth.Credentials, permMask fs.PermMask) (*linux.Sem // SetVal overrides a semaphore value, waking up waiters as needed. func (s *Set) SetVal(ctx context.Context, num int32, val int16, creds *auth.Credentials, pid int32) error { if val < 0 || val > valueMax { - return syserror.ERANGE + return linuxerr.ERANGE } s.mu.Lock() @@ -431,7 +431,7 @@ func (s *Set) SetVal(ctx context.Context, num int32, val int16, creds *auth.Cred sem := s.findSem(num) if sem == nil { - return syserror.ERANGE + return linuxerr.ERANGE } // TODO(gvisor.dev/issue/137): Clear undo entries in all processes. @@ -453,7 +453,7 @@ func (s *Set) SetValAll(ctx context.Context, vals []uint16, creds *auth.Credenti for _, val := range vals { if val > valueMax { - return syserror.ERANGE + return linuxerr.ERANGE } } @@ -489,7 +489,7 @@ func (s *Set) GetVal(num int32, creds *auth.Credentials) (int16, error) { sem := s.findSem(num) if sem == nil { - return 0, syserror.ERANGE + return 0, linuxerr.ERANGE } return sem.value, nil } @@ -523,7 +523,7 @@ func (s *Set) GetPID(num int32, creds *auth.Credentials) (int32, error) { sem := s.findSem(num) if sem == nil { - return 0, syserror.ERANGE + return 0, linuxerr.ERANGE } return sem.pid, nil } @@ -539,7 +539,7 @@ func (s *Set) countWaiters(num int32, creds *auth.Credentials, pred func(w *wait sem := s.findSem(num) if sem == nil { - return 0, syserror.ERANGE + return 0, linuxerr.ERANGE } var cnt uint16 for w := sem.waiters.Front(); w != nil; w = w.Next() { @@ -625,7 +625,7 @@ func (s *Set) executeOps(ctx context.Context, ops []linux.Sembuf, pid int32) (ch if op.SemOp < 0 { // Handle 'wait' operation. if -op.SemOp > valueMax { - return nil, 0, syserror.ERANGE + return nil, 0, linuxerr.ERANGE } if -op.SemOp > tmpVals[op.SemNum] { // Not enough resources, must wait. @@ -640,7 +640,7 @@ func (s *Set) executeOps(ctx context.Context, ops []linux.Sembuf, pid int32) (ch } else { // op.SemOp > 0: Handle 'signal' operation. if tmpVals[op.SemNum] > valueMax-op.SemOp { - return nil, 0, syserror.ERANGE + return nil, 0, linuxerr.ERANGE } } |