mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 22:05:36 +00:00
dump: Check for pids reuse at suspend
While we try to seize task it can die and give its pid to somebody else. This can break pstree consistency. Check for parent being valid after task is seized. Signed-off-by: Pavel Emelyanov <xemul@parallels.com> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
This commit is contained in:
committed by
Cyrill Gorcunov
parent
f8a18edd44
commit
199e8d8248
@@ -190,10 +190,10 @@ int parse_pid_stat_small(pid_t pid, struct proc_pid_stat_small *s)
|
||||
return -1;
|
||||
|
||||
memset(s, 0, sizeof(*s));
|
||||
n = fscanf(f, "%d " PROC_TASK_COMM_LEN_FMT " %c",
|
||||
&s->pid, s->comm, &s->state);
|
||||
n = fscanf(f, "%d " PROC_TASK_COMM_LEN_FMT " %c %d",
|
||||
&s->pid, s->comm, &s->state, &s->ppid);
|
||||
|
||||
if (n < 3) {
|
||||
if (n < 4) {
|
||||
pr_err("Parsing %d's stat failed (#fields do not match)\n", pid);
|
||||
return -1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user