summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel/task_exec.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-08-27 20:25:51 +0000
committergVisor bot <gvisor-bot@google.com>2021-08-27 20:25:51 +0000
commitac5bbb582c3d828b337dc3b0ce8b7ce41519d4dd (patch)
treeb7b4198cd4ba286ee37e407b1f643aa9407994b2 /pkg/sentry/kernel/task_exec.go
parent8416dca58aa8e1c9ab0ed5dfd4a3cdf8bd9ffef6 (diff)
parentf7281c6cb9bbf3e5757adf52a7820499b5a7483b (diff)
Merge release-20210816.0-52-gf7281c6cb (automated)
Diffstat (limited to 'pkg/sentry/kernel/task_exec.go')
-rw-r--r--pkg/sentry/kernel/task_exec.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkg/sentry/kernel/task_exec.go b/pkg/sentry/kernel/task_exec.go
index 9175b911c..db91fc4d8 100644
--- a/pkg/sentry/kernel/task_exec.go
+++ b/pkg/sentry/kernel/task_exec.go
@@ -222,9 +222,15 @@ func (r *runSyscallAfterExecStop) execute(t *Task) taskRunState {
// Update credentials to reflect the execve. This should precede switching
// MMs to ensure that dumpability has been reset first, if needed.
t.updateCredsForExecLocked()
- t.image.release()
+ oldImage := t.image
t.image = *r.image
t.mu.Unlock()
+
+ // Don't hold t.mu while calling t.image.release(), that may
+ // attempt to acquire TaskImage.MemoryManager.mappingMu, a lock order
+ // violation.
+ oldImage.release()
+
t.unstopVforkParent()
t.p.FullStateChanged()
// NOTE(b/30316266): All locks must be dropped prior to calling Activate.