]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
start: check event loop type before closing fd 4020/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 28 Oct 2021 15:39:42 +0000 (17:39 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 28 Oct 2021 15:39:42 +0000 (17:39 +0200)
Since this is a union we might otherwise stomp on io_uring mmap()ed
memory.

Fixes: #4016
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/start.c

index 8f7173ec8cea6af0d098f10ddf59085a14bc892d..1a6046c7a40d8b4bb3aebcf521545b3fce7db355 100644 (file)
@@ -629,7 +629,8 @@ int lxc_poll(const char *name, struct lxc_handler *handler)
        TRACE("Mainloop is ready");
 
        ret = lxc_mainloop(&descr, -1);
-       close_prot_errno_disarm(descr.epfd);
+       if (descr.type == LXC_MAINLOOP_EPOLL)
+               close_prot_errno_disarm(descr.epfd);
        if (ret < 0 || !handler->init_died)
                goto out_mainloop_console;