From f58dbc646a9aa7ecb3f257f1d5c9f3af6ef13243 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Wed, 11 Mar 2026 13:07:32 +0000 Subject: [PATCH] init: exit clock_worker child process on failure If clock_worker() returns due to an error (socket creation, bind, or recv failure), the child process falls through into the rest of main(), forking again and duplicating the workload execution. Add _exit(1) after clock_worker() to prevent the child from continuing. Fixes: https://github.com/containers/libkrun/issues/580 Signed-off-by: Jakub Hrozek --- init/init.c | 1 + 1 file changed, 1 insertion(+) diff --git a/init/init.c b/init/init.c index 855b3778c..3d006e11d 100644 --- a/init/init.c +++ b/init/init.c @@ -1202,6 +1202,7 @@ int main(int argc, char **argv) #ifdef __TIMESYNC__ if (fork() == 0) { clock_worker(); + _exit(1); } #endif