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 <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner 2021-10-28 17:39:42 +02:00
parent aac3f106ff
commit a585382b97
No known key found for this signature in database
GPG Key ID: 8EB056D53EECB12D

View File

@ -629,7 +629,8 @@ int lxc_poll(const char *name, struct lxc_handler *handler)
TRACE("Mainloop is ready"); TRACE("Mainloop is ready");
ret = lxc_mainloop(&descr, -1); 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) if (ret < 0 || !handler->init_died)
goto out_mainloop_console; goto out_mainloop_console;