pid_ns: zap_pid_ns_processes: fix the ->child_reaper changing
Changes
1 files changed · +6 −3
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| kernel/pid_namespace.c | modified | +6 | −3 | View file |
kernel/pid_namespace.c
View filediff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c
index ea567b7..598f1ee 100644
--- a/kernel/pid_namespace.c
+++ b/kernel/pid_namespace.c
@@ -179,9 +179,12 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns)
rc = sys_wait4(-1, NULL, __WALL, NULL);
} while (rc != -ECHILD);
-
- /* Child reaper for the pid namespace is going away */
- pid_ns->child_reaper = NULL;
+ /*
+ * We can not clear ->child_reaper or leave it alone.
+ * There may by stealth EXIT_DEAD tasks on ->children,
+ * forget_original_parent() must move them somewhere.
+ */
+ pid_ns->child_reaper = init_pid_ns.child_reaper;
acct_exit_ns(pid_ns);
return;
}