Commit 06cc1951 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Cyrill Gorcunov

ptrace: Send signals with final state explicitly

According to Oleg the PTRACE_KILL doesn't and was-not-supposed-to work.
Thus, kill tasks to final state explicitly and just detach from them.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent cff9654d
...@@ -21,15 +21,14 @@ ...@@ -21,15 +21,14 @@
int unseize_task(pid_t pid, enum cr_task_state st) int unseize_task(pid_t pid, enum cr_task_state st)
{ {
if (st == CR_TASK_STOP) if (st == CR_TASK_KILL)
return ptrace(PTRACE_DETACH, pid, NULL, NULL);
else if (st == CR_TASK_KILL) {
kill(pid, SIGKILL); kill(pid, SIGKILL);
return ptrace(PTRACE_KILL, pid, NULL, NULL); else if (st == CR_TASK_STOP)
} else { kill(pid, SIGSTOP);
BUG_ON(1); else
return -1; pr_err("Unknown final state %d\n", st);
}
return ptrace(PTRACE_DETACH, pid, NULL, NULL);
} }
/* /*
......
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