mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-22 18:05:10 +00:00
cr-restore/shstk: Make arch_shstk_unlock use correct pid
In a simple case where the parent process and the child one are in one
pid namespace we can safely use vpid(item) to prace the child. But, for
the cases where the child is a pid namespace init, or the child is put
into external pid namespace, the parent and the child have different pid
namespaces and using pid vpid(item) (which e.g. for init will always be
1 here) to ptrace the child process is inorrect.
Let's use the pid reported to us from clone as it's always the right pid
of the child from the parent's point of view.
Fixes: 7dd583002 ("restore: add infrastructure to enable shadow stack")
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
This commit is contained in:
parent
07af3304fd
commit
21a6758268
1 changed files with 1 additions and 1 deletions
|
|
@ -1238,7 +1238,7 @@ static inline int fork_with_pid(struct pstree_item *item)
|
|||
pr_debug("PID: real %d virt %d\n", item->pid->real, vpid(item));
|
||||
}
|
||||
|
||||
arch_shstk_unlock(item, ca.core, pid);
|
||||
arch_shstk_unlock(item, ca.core, ret);
|
||||
|
||||
err_unlock:
|
||||
if (!(ca.clone_flags & CLONE_NEWPID))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue