diff --git a/cr-restore.c b/cr-restore.c index 614fee251..dd9868e9d 100644 --- a/cr-restore.c +++ b/cr-restore.c @@ -1055,7 +1055,7 @@ static inline int fork_with_pid(struct pstree_item *item) item->state = ca.core->tc->task_state; rsti(item)->cg_set = ca.core->tc->cg_set; - item->has_seccomp = ca.core->tc->seccomp_mode != SECCOMP_MODE_DISABLED; + rsti(item)->has_seccomp = ca.core->tc->seccomp_mode != SECCOMP_MODE_DISABLED; if (item->state == TASK_DEAD) rsti(item->parent)->nr_zombies++; @@ -1686,7 +1686,7 @@ static void finalize_restore(int status) * doing an munmap in the process, which may be blocked by * seccomp and cause the task to be killed. */ - if (item->has_seccomp && suspend_seccomp(pid) < 0) + if (rsti(item)->has_seccomp && suspend_seccomp(pid) < 0) pr_err("failed to suspend seccomp, restore will probably fail...\n"); ctl = parasite_prep_ctl(pid, NULL); diff --git a/include/pstree.h b/include/pstree.h index 75833154c..a09e9561d 100644 --- a/include/pstree.h +++ b/include/pstree.h @@ -24,12 +24,6 @@ struct pstree_item { int state; /* TASK_XXX constants */ - /* - * On restore, we set this flag when process has seccomp filters so - * that we know to suspend them before we unmap the restorer blob. - */ - bool has_seccomp; - int nr_threads; /* number of threads */ struct pid *threads; /* array of threads */ CoreEntry **core; diff --git a/include/rst_info.h b/include/rst_info.h index d85076149..5fab1621f 100644 --- a/include/rst_info.h +++ b/include/rst_info.h @@ -58,6 +58,13 @@ struct rst_info { bool has_umask; u32 umask; + /* + * We set this flag when process has seccomp filters + * so that we know to suspend them before we unmap the + * restorer blob. + */ + bool has_seccomp; + void *breakpoint; };