diff --git a/pkg/sentry/kernel/task_exit.go b/pkg/sentry/kernel/task_exit.go index 38cc377cb..69a174180 100644 --- a/pkg/sentry/kernel/task_exit.go +++ b/pkg/sentry/kernel/task_exit.go @@ -798,13 +798,14 @@ func (t *Task) execOnDestroyActions() { if len(actions) == 0 { return } + ctx := t.k.SupervisorContext() // Block S/R until all actions is executed. t.k.tasks.aioGoroutines.Add(1) // Run in another goroutine to avoid extra lock dependencies. go func() { defer t.k.tasks.aioGoroutines.Done() for act := range actions { - act.TaskDestroyAction(t) + act.TaskDestroyAction(ctx) } }() }