Kaynağa Gözat

[LibOS] Allow LibOS handles without backing PAL handles in epoll

Previously, Graphene failed with -EPERM on epoll_ctl(EPOLL_CTL_ADD)
of a LibOS shim handle without a backing PAL handle. However, it is
possible for a LibOS socket handle to not have a PAL handle: if
user app first creates the handle via socket(), then adds it to epoll
via epoll_ctl(), and only then performs bind() at which point PAL
handle is finally created. This commit removes this restriction.
Dmitrii Kuvaiskii 5 yıl önce
ebeveyn
işleme
4485f5af98
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      LibOS/shim/src/sys/shim_epoll.c

+ 1 - 1
LibOS/shim/src/sys/shim_epoll.c

@@ -193,7 +193,7 @@ int shim_do_epoll_ctl(int epfd, int op, int fd, struct __kernel_epoll_event* eve
                 goto out;
             }
             /* note that pipe and socket may not have pal_handle yet (e.g. before bind()) */
-            if ((hdl->type != TYPE_PIPE && hdl->type != TYPE_SOCK && hdl->type != TYPE_EVENTFD) || !hdl->pal_handle) {
+            if (hdl->type != TYPE_PIPE && hdl->type != TYPE_SOCK && hdl->type != TYPE_EVENTFD) {
                 ret = -EPERM;
                 put_handle(hdl);
                 goto out;