Commit 2020d395 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

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: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 8eabba3d
...@@ -1402,6 +1402,13 @@ static int dump_one_task(struct pstree_item *item) ...@@ -1402,6 +1402,13 @@ static int dump_one_task(struct pstree_item *item)
pr_info("sid=%d pgid=%d pid=%d\n", pr_info("sid=%d pgid=%d pid=%d\n",
item->sid, item->pgid, item->pid.virt); 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; ret = -1;
cr_fdset = cr_task_fdset_open(item->pid.virt, O_DUMP); cr_fdset = cr_task_fdset_open(item->pid.virt, O_DUMP);
if (!cr_fdset) if (!cr_fdset)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment