diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-09-29 11:51:10 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-09-29 11:51:10 -0700 |
commit | 7d64bc1fdf538869de5964475110a69580b481ad (patch) | |
tree | f200e78e078c95a3ddabb812de5da3bb80bf1f3a /pkg/sentry/socket/hostinet | |
parent | f15182243e508b0754d59350a886397e2a0ba0b2 (diff) | |
parent | 71f8cab91b2005c9e3ab904e3a2cba99cb031230 (diff) |
Merge pull request #3875 from btw616:fix/issue-3874
PiperOrigin-RevId: 334428344
Diffstat (limited to 'pkg/sentry/socket/hostinet')
-rw-r--r-- | pkg/sentry/socket/hostinet/socket_vfs2.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/sentry/socket/hostinet/socket_vfs2.go b/pkg/sentry/socket/hostinet/socket_vfs2.go index 87b077e68..163af329b 100644 --- a/pkg/sentry/socket/hostinet/socket_vfs2.go +++ b/pkg/sentry/socket/hostinet/socket_vfs2.go @@ -78,6 +78,13 @@ func newVFS2Socket(t *kernel.Task, family int, stype linux.SockType, protocol in return vfsfd, nil } +// Release implements vfs.FileDescriptionImpl.Release. +func (s *socketVFS2) Release(ctx context.Context) { + t := kernel.TaskFromContext(ctx) + t.Kernel().DeleteSocketVFS2(&s.vfsfd) + s.socketOpsCommon.Release(ctx) +} + // Readiness implements waiter.Waitable.Readiness. func (s *socketVFS2) Readiness(mask waiter.EventMask) waiter.EventMask { return s.socketOpsCommon.Readiness(mask) |