summaryrefslogtreecommitdiffhomepage
path: root/runsc/boot
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2021-06-10 13:47:43 -0700
committergVisor bot <gvisor-bot@google.com>2021-06-10 13:55:10 -0700
commitd81fcbf85c771a75bcf6600a02b3d411c6f7e383 (patch)
tree7637774c682f7717ca1389f0db9bac11027ce548 /runsc/boot
parent21169357ca913de9cef50da6f235a482b7a3cfab (diff)
Set RLimits during `runsc exec`
PiperOrigin-RevId: 378726430
Diffstat (limited to 'runsc/boot')
-rw-r--r--runsc/boot/loader.go7
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