From c7395f4cbedc5cf0dd86a2c7aa12e58e33ffc2f4 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Sun, 14 Sep 2025 18:44:51 -0700 Subject: [PATCH] files: fork helpers without CLONE_FILES | CLONE_FS On restore, CRIU needs to change mount namespaces to properly restore files and unix sockets. However, the kernel prevents this if a process is sharing its file system information (fs) with other processes. Fixes #2687 Signed-off-by: Andrei Vagin --- criu/files.c | 1 - criu/pstree.c | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/criu/files.c b/criu/files.c index f16ec32a2..af4b8aeac 100644 --- a/criu/files.c +++ b/criu/files.c @@ -1329,7 +1329,6 @@ int prepare_fds(struct pstree_item *me) } } - BUG_ON(current->pid->state == TASK_HELPER); ret = open_fdinfos(me); if (rsti(me)->fdt) diff --git a/criu/pstree.c b/criu/pstree.c index 75c2fc8d0..cee8b5741 100644 --- a/criu/pstree.c +++ b/criu/pstree.c @@ -237,9 +237,8 @@ int init_pstree_helper(struct pstree_item *ret) { BUG_ON(!ret->parent); ret->pid->state = TASK_HELPER; - rsti(ret)->clone_flags = CLONE_FILES | CLONE_FS; - if (shared_fdt_prepare(ret) < 0) - return -1; + rsti(ret)->clone_flags = 0; + INIT_LIST_HEAD(&rsti(ret)->fds); task_entries->nr_helpers++; return 0; }