mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-25 11:04:35 +00:00
ns: Set target user_ns after net_ns is set
Restore task's user_ns, and keep in mind we born in parent's user_ns Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
87ad5ec22c
commit
69b412ec82
1 changed files with 8 additions and 0 deletions
|
|
@ -873,6 +873,9 @@ static int restore_one_alive_task(int pid, CoreEntry *core)
|
|||
if (restore_task_net_ns(current))
|
||||
return -1;
|
||||
|
||||
if (current->ids && set_user_ns(current->ids->user_ns_id) < 0)
|
||||
return -1;
|
||||
|
||||
if (setup_uffd(pid, ta))
|
||||
return -1;
|
||||
|
||||
|
|
@ -1180,6 +1183,11 @@ static inline int fork_with_pid(struct pstree_item *item)
|
|||
int ret = -1;
|
||||
pid_t pid = vpid(item);
|
||||
|
||||
if (item != root_item)
|
||||
item->user_ns = current->user_ns;
|
||||
else
|
||||
item->user_ns = root_user_ns;
|
||||
|
||||
if (item->pid->state != TASK_HELPER) {
|
||||
if (open_core(pid, &ca.core))
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue