From cd56935ddf7783b7f85c12511020f1e83b39dc5c Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Thu, 18 Jul 2024 14:14:33 -0700 Subject: [PATCH] runsc: pass the GLIBC_TUNABLES env to the sandbox process It is required to disable rseq for runsc-race. PiperOrigin-RevId: 653752784 --- runsc/sandbox/sandbox.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/runsc/sandbox/sandbox.go b/runsc/sandbox/sandbox.go index ea6acb6a1..d1a3758ad 100644 --- a/runsc/sandbox/sandbox.go +++ b/runsc/sandbox/sandbox.go @@ -811,6 +811,11 @@ func (s *Sandbox) createSandboxProcess(conf *config.Config, args *Args, startSyn if !conf.TestOnlyAllowRunAsCurrentUserWithoutChroot { // Setting cmd.Env = nil causes cmd to inherit the current process's env. cmd.Env = []string{} + // runsc-race with glibc needs to disable rseq. + glibcTunables := os.Getenv("GLIBC_TUNABLES") + if glibcTunables != "" { + cmd.Env = append(cmd.Env, fmt.Sprintf("GLIBC_TUNABLES=%s", glibcTunables)) + } } // If there is a gofer, sends all socket ends to the sandbox.