Don't eat error from epoll_ctl EPOLL_CTL_ADD

Docker maps stdin to `/dev/null` which doesn't support epoll. Host FD
was ignoring the error and suceeding the epoll_ctl call from the
container, giving false impressing that epoll would be notified.

This required plumbing failure to all waiter.Waitable.EventRegister
callers and implementers.

Closes #6795

PiperOrigin-RevId: 414797621
This commit is contained in:
Fabricio Voznika
2021-12-07 12:36:00 -08:00
committed by gVisor bot
parent d62190f8b5
commit 9768009a79
54 changed files with 359 additions and 141 deletions
+6
View File
@@ -3393,4 +3393,10 @@ func (s *socketOpsCommon) Type() (family int, skType linux.SockType, protocol in
return s.family, s.skType, s.protocol
}
// EventRegister implements waiter.Waitable.
func (s *socketOpsCommon) EventRegister(e *waiter.Entry) error {
s.Queue.EventRegister(e)
return nil
}
// LINT.ThenChange(./netstack_vfs2.go)
+2 -1
View File
@@ -90,8 +90,9 @@ func (s *SocketVFS2) Readiness(mask waiter.EventMask) waiter.EventMask {
}
// EventRegister implements waiter.Waitable.EventRegister.
func (s *SocketVFS2) EventRegister(e *waiter.Entry) {
func (s *SocketVFS2) EventRegister(e *waiter.Entry) error {
s.socketOpsCommon.EventRegister(e)
return nil
}
// EventUnregister implements waiter.Waitable.EventUnregister.