From c06dba4845b61bd4eed052fb7d24423bbf2867c3 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Thu, 6 Feb 2025 13:49:51 +0100 Subject: [PATCH] rootless: fix hang on s390x avoid using the glibc fork() function after using directly the clone() syscall, as it confuses glibc causing the fork() to hang in some cases. The issue has been observed only on s390x, and the fix was confirmed in the issue discussion. Closes: https://github.com/containers/podman/issues/25184 Signed-off-by: Giuseppe Scrivano --- pkg/rootless/rootless_linux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/rootless/rootless_linux.c b/pkg/rootless/rootless_linux.c index 4f71d49e5c..3d74af6a6c 100644 --- a/pkg/rootless/rootless_linux.c +++ b/pkg/rootless/rootless_linux.c @@ -658,7 +658,7 @@ create_pause_process (const char *pause_pid_file_path, char **argv) if (pipe (p) < 0) return -1; - pid = fork (); + pid = syscall_clone (SIGCHLD, NULL); if (pid < 0) { close (p[0]); @@ -689,7 +689,7 @@ create_pause_process (const char *pause_pid_file_path, char **argv) close (p[0]); setsid (); - pid = fork (); + pid = syscall_clone (SIGCHLD, NULL); if (pid < 0) _exit (EXIT_FAILURE);