runsc: pass the GLIBC_TUNABLES env to the sandbox process

It is required to disable rseq for runsc-race.

PiperOrigin-RevId: 653752784
This commit is contained in:
Andrei Vagin
2024-07-18 14:19:36 -07:00
committed by gVisor bot
parent 489ac10c69
commit cd56935ddf
+5
View File
@@ -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.