diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-04-15 23:36:02 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-04-15 23:36:02 +0000 |
commit | 13721e8f68127f6b43ddb342a709de5fddc80159 (patch) | |
tree | 116a5800b60e82f204e56273dd6a828ee049745c | |
parent | 7fb9bc07e54e48cbb1127113cd3f3ffbd29d4bc1 (diff) | |
parent | b5919d3065a28c1fd6f27612bafd28f06bf3f0d0 (diff) |
Merge release-20210408.0-34-gb5919d306 (automated)
-rw-r--r-- | pkg/sentry/fsimpl/host/host.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/sentry/fsimpl/host/host.go b/pkg/sentry/fsimpl/host/host.go index 3b90375b6..a81f550b1 100644 --- a/pkg/sentry/fsimpl/host/host.go +++ b/pkg/sentry/fsimpl/host/host.go @@ -460,6 +460,9 @@ func (i *inode) DecRef(ctx context.Context) { if err := unix.Close(i.hostFD); err != nil { log.Warningf("failed to close host fd %d: %v", i.hostFD, err) } + // We can't rely on fdnotifier when closing the fd, because the event may race + // with fdnotifier.RemoveFD. Instead, notify the queue explicitly. + i.queue.Notify(waiter.EventHUp | waiter.ReadableEvents | waiter.WritableEvents) }) } |