summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-02-19 19:29:50 +0000
committergVisor bot <gvisor-bot@google.com>2021-02-19 19:29:50 +0000
commite022d8215a4b09ff91cca7dee15dc12aa7c03055 (patch)
tree8d26d1b3b0bf60f4b40364655317c900db796bf9
parentf449dff059655aff19033d202321de15aca90a38 (diff)
parent5e22ab93e6b44c036a6ec56858df0874729c4baa (diff)
Merge release-20210208.0-76-g5e22ab93e (automated)
-rw-r--r--pkg/sentry/control/proc.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/sentry/control/proc.go b/pkg/sentry/control/proc.go
index de7a0f3ab..f93bd64e0 100644
--- a/pkg/sentry/control/proc.go
+++ b/pkg/sentry/control/proc.go
@@ -147,6 +147,10 @@ func (proc *Proc) execAsync(args *ExecArgs) (*kernel.ThreadGroup, kernel.ThreadI
args.Capabilities,
proc.Kernel.RootUserNamespace())
+ pidns := args.PIDNamespace
+ if pidns == nil {
+ pidns = proc.Kernel.RootPIDNamespace()
+ }
initArgs := kernel.CreateProcessArgs{
Filename: args.Filename,
Argv: args.Argv,
@@ -163,7 +167,7 @@ func (proc *Proc) execAsync(args *ExecArgs) (*kernel.ThreadGroup, kernel.ThreadI
IPCNamespace: proc.Kernel.RootIPCNamespace(),
AbstractSocketNamespace: proc.Kernel.RootAbstractSocketNamespace(),
ContainerID: args.ContainerID,
- PIDNamespace: args.PIDNamespace,
+ PIDNamespace: pidns,
}
if initArgs.MountNamespace != nil {
// initArgs must hold a reference on MountNamespace, which will