mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-01 14:55:39 +00:00
ns: Use CLONE_VM in create_user_ns_hierarhy_fn()
This function may call functions like open_proc(), so use CLONE_VM to reflect children open files in parent memory. v3: New Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
committed by
Andrei Vagin
parent
10989ef274
commit
47170c462d
@@ -2233,7 +2233,7 @@ static int create_user_ns_hierarhy_fn(void *in_arg)
|
|||||||
arg->me = child;
|
arg->me = child;
|
||||||
futex_init(futex);
|
futex_init(futex);
|
||||||
|
|
||||||
pid = clone(create_user_ns_hierarhy_fn, stack, CLONE_NEWUSER | CLONE_FILES | SIGCHLD, arg);
|
pid = clone(create_user_ns_hierarhy_fn, stack, CLONE_NEWUSER | CLONE_VM | CLONE_FILES | SIGCHLD, arg);
|
||||||
if (pid < 0) {
|
if (pid < 0) {
|
||||||
pr_perror("Can't clone");
|
pr_perror("Can't clone");
|
||||||
goto out;
|
goto out;
|
||||||
@@ -2250,8 +2250,10 @@ static int create_user_ns_hierarhy_fn(void *in_arg)
|
|||||||
errno = 0;
|
errno = 0;
|
||||||
if (wait(&status) < 0 || !WIFEXITED(status) || WEXITSTATUS(status)) {
|
if (wait(&status) < 0 || !WIFEXITED(status) || WEXITSTATUS(status)) {
|
||||||
pr_perror("Child process waiting: %d", status);
|
pr_perror("Child process waiting: %d", status);
|
||||||
|
close_pid_proc();
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
close_pid_proc();
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
Reference in New Issue
Block a user