summaryrefslogtreecommitdiffhomepage
path: root/lib/uloop.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-11-29 09:53:29 +0100
committerJo-Philipp Wich <jo@mein.io>2022-11-29 09:56:33 +0100
commit1867c8b7ae47c8342c264aac752340e09a3593e4 (patch)
tree3948080a86b59b77030801bb48fb7d5140562614 /lib/uloop.c
parent191a536c04382270538bc2973c6a97d4d66725f3 (diff)
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 <jo@mein.io>
Diffstat (limited to 'lib/uloop.c')
-rw-r--r--lib/uloop.c2
1 files changed, 2 insertions, 0 deletions
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);