diff options
author | Andrei Vagin <avagin@google.com> | 2021-09-01 11:46:02 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-09-01 11:48:23 -0700 |
commit | 927ea16dd384f675a2ce1456be457a371109c488 (patch) | |
tree | d4131e5e5b84e0d6629259fd27793693656e8f1d /pkg/sentry | |
parent | 5e3a5189152e682f94c745a544993c26e18eb9a2 (diff) |
unix: handle a case when a buffer is overflowed
Reported-by: syzbot+1aab6800bd14829609b8@syzkaller.appspotmail.com
PiperOrigin-RevId: 394279838
Diffstat (limited to 'pkg/sentry')
-rw-r--r-- | pkg/sentry/socket/unix/transport/queue.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/sentry/socket/unix/transport/queue.go b/pkg/sentry/socket/unix/transport/queue.go index e4de44498..a9cedcf5f 100644 --- a/pkg/sentry/socket/unix/transport/queue.go +++ b/pkg/sentry/socket/unix/transport/queue.go @@ -133,7 +133,7 @@ func (q *queue) Enqueue(ctx context.Context, data [][]byte, c ControlMessages, f free := q.limit - q.used if l > free && truncate { - if free == 0 { + if free <= 0 { // Message can't fit right now. q.mu.Unlock() return 0, false, syserr.ErrWouldBlock |