From 1867c8b7ae47c8342c264aac752340e09a3593e4 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 29 Nov 2022 09:53:29 +0100 Subject: uloop: terminate parent uloop in task child processes Ensure that the main process uloop is terminated within task child processes. Before this fix, using uloop in a task function would trigger invalid memory accesses in the parent process by notifying non-existing fd slots in the parent through the inherited shared epoll descriptor. Signed-off-by: Jo-Philipp Wich --- lib/uloop.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/uloop.c b/lib/uloop.c index 48ff698..f45f8c3 100644 --- a/lib/uloop.c +++ b/lib/uloop.c @@ -976,6 +976,8 @@ uc_uloop_task(uc_vm_t *vm, size_t nargs) err_return(errno); if (pid == 0) { + uloop_done(); + patch_devnull(0, false); patch_devnull(1, true); patch_devnull(2, true); -- cgit v1.2.3