diff options
author | Brian Geffon <bgeffon@google.com> | 2018-06-01 14:58:46 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-06-01 14:59:47 -0700 |
commit | 0212f222c74b9f88c5c74d920127e47e942dc376 (patch) | |
tree | 02eae6bce53d1b0010cd472226ee86833210cf92 /pkg/sentry | |
parent | 659b10d1a6a236765be8b6e6dc0d72eaa55253ee (diff) |
Fix refcount bug in rpcinet socketOperations.Accept.
PiperOrigin-RevId: 198931222
Change-Id: I69ee12318e87b9a6a4a94b18a9bf0ae4e39d7eaf
Diffstat (limited to 'pkg/sentry')
-rw-r--r-- | pkg/sentry/socket/rpcinet/socket.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pkg/sentry/socket/rpcinet/socket.go b/pkg/sentry/socket/rpcinet/socket.go index bca91ab5f..74cb84927 100644 --- a/pkg/sentry/socket/rpcinet/socket.go +++ b/pkg/sentry/socket/rpcinet/socket.go @@ -277,8 +277,10 @@ func (s *socketOperations) Accept(t *kernel.Task, peerRequested bool, flags int, file := fs.NewFile(t, dirent, fs.FileFlags{Read: true, Write: true, NonBlocking: flags&linux.SOCK_NONBLOCK != 0}, &socketOperations{ wq: &wq, fd: payload.Fd, + rpcConn: s.rpcConn, notifier: s.notifier, }) + defer file.DecRef() fdFlags := kernel.FDFlags{ CloseOnExec: flags&linux.SOCK_CLOEXEC != 0, |