summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-02-09 18:41:41 +0000
committergVisor bot <gvisor-bot@google.com>2021-02-09 18:41:41 +0000
commit9ca9e6bb60ebba31a1293782ec25af0b2991c4dd (patch)
treece4b9952ff55bb68593f7155e99c558494471aa6 /pkg/sentry/kernel
parent7dc93f4645e36b0faf2a56662740892085ef9afb (diff)
parentfe4f4789601ddf61260271f7e1d33ba0f2756fcd (diff)
Merge release-20210201.0-64-gfe4f47896 (automated)
Diffstat (limited to 'pkg/sentry/kernel')
-rw-r--r--pkg/sentry/kernel/task_exit.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/sentry/kernel/task_exit.go b/pkg/sentry/kernel/task_exit.go
index 16986244c..f7765fa3a 100644
--- a/pkg/sentry/kernel/task_exit.go
+++ b/pkg/sentry/kernel/task_exit.go
@@ -415,6 +415,12 @@ func (tg *ThreadGroup) anyNonExitingTaskLocked() *Task {
func (t *Task) reparentLocked(parent *Task) {
oldParent := t.parent
t.parent = parent
+ if oldParent != nil {
+ delete(oldParent.children, t)
+ }
+ if parent != nil {
+ parent.children[t] = struct{}{}
+ }
// If a thread group leader's parent changes, reset the thread group's
// termination signal to SIGCHLD and re-check exit notification. (Compare
// kernel/exit.c:reparent_leader().)