2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 05:48:05 +00:00

dump: prevent dumping if a session leader is outside of the current pidns

A parasite code returns zero sid for such cases.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrey Vagin 2013-04-01 20:11:13 +04:00 committed by Pavel Emelyanov
parent 8eabba3d1c
commit 2020d3957e

View File

@ -1402,6 +1402,13 @@ static int dump_one_task(struct pstree_item *item)
pr_info("sid=%d pgid=%d pid=%d\n",
item->sid, item->pgid, item->pid.virt);
if (item->sid == 0) {
pr_err("A session leader of %d(%d) is outside of its pid namespace\n",
item->pid.real, item->pid.virt);
ret = -1;
goto err_cure;
}
ret = -1;
cr_fdset = cr_task_fdset_open(item->pid.virt, O_DUMP);
if (!cr_fdset)