diff options
author | Fabricio Voznika <fvoznika@google.com> | 2021-06-10 13:47:43 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-06-10 13:55:10 -0700 |
commit | d81fcbf85c771a75bcf6600a02b3d411c6f7e383 (patch) | |
tree | 7637774c682f7717ca1389f0db9bac11027ce548 /runsc/boot/loader.go | |
parent | 21169357ca913de9cef50da6f235a482b7a3cfab (diff) |
Set RLimits during `runsc exec`
PiperOrigin-RevId: 378726430
Diffstat (limited to 'runsc/boot/loader.go')
-rw-r--r-- | runsc/boot/loader.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/runsc/boot/loader.go b/runsc/boot/loader.go index 111d30154..ad4d50008 100644 --- a/runsc/boot/loader.go +++ b/runsc/boot/loader.go @@ -963,10 +963,15 @@ func (l *Loader) executeAsync(args *control.ExecArgs) (kernel.ThreadID, error) { } args.Envv = envv } + args.PIDNamespace = tg.PIDNamespace() + + args.Limits, err = createLimitSet(l.root.spec) + if err != nil { + return 0, fmt.Errorf("creating limits: %w", err) + } // Start the process. proc := control.Proc{Kernel: l.k} - args.PIDNamespace = tg.PIDNamespace() newTG, tgid, ttyFile, ttyFileVFS2, err := control.ExecAsync(&proc, args) if err != nil { return 0, err |