From: Christian Brauner Date: Thu, 28 Oct 2021 15:39:42 +0000 (+0200) Subject: start: check event loop type before closing fd X-Git-Tag: lxc-5.0.0~60^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a585382b972c25ee8489147d94918d001ef439a7;p=thirdparty%2Flxc.git start: check event loop type before closing fd Since this is a union we might otherwise stomp on io_uring mmap()ed memory. Fixes: #4016 Signed-off-by: Christian Brauner --- diff --git a/src/lxc/start.c b/src/lxc/start.c index 8f7173ec8..1a6046c7a 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -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;