mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-17 16:47:50 +00:00
ptrace: don't call PTRACE_INTERRUPT many times
According to the commit message in the kernel git, a new trap flag JOBCTL_TRAP_INTERRUPT is added, which is set on PTRACE_INTERRUPT and cleared when any trap happens. Currently we have a race window beetwen PTRACE_CONT and PTRACE_INTERRUPT. If a process stops before PTRACE_INTERRUPT, the flag JOBCTL_TRAP_INTERRUPT will be set once again. https://bugzilla.openvz.org/show_bug.cgi?id=2569 Signed-off-by: Andrey Vagin <avagin@openvz.org> Acked-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
66c21e22cc
commit
d4e1df3a03
1 changed files with 2 additions and 1 deletions
3
ptrace.c
3
ptrace.c
|
|
@ -88,13 +88,14 @@ int seize_task(pid_t pid, pid_t ppid, pid_t *pgid, pid_t *sid)
|
|||
pid, ppid, ps.ppid);
|
||||
goto err;
|
||||
}
|
||||
try_again:
|
||||
|
||||
ret = ptrace(PTRACE_INTERRUPT, pid, NULL, NULL);
|
||||
if (ret < 0) {
|
||||
pr_perror("SEIZE %d: can't interrupt task", pid);
|
||||
goto err;
|
||||
}
|
||||
|
||||
try_again:
|
||||
ret = wait4(pid, &status, __WALL, NULL);
|
||||
if (ret < 0) {
|
||||
pr_perror("SEIZE %d: can't wait task", pid);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue