From f9705477d023c63fb316a30204761aa1e3cb3e6d Mon Sep 17 00:00:00 2001 From: Shane Canon Date: Sat, 31 May 2014 10:20:07 -0700 Subject: [PATCH] Fix for setuid race condition in LXC driver This is a fix for a race condition in the LXC driver. This is described more in issue #6092. Closes #6092 Docker-DCO-1.1-Signed-off-by: Shane Canon (github: scanon) --- daemon/execdriver/lxc/driver.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/daemon/execdriver/lxc/driver.go b/daemon/execdriver/lxc/driver.go index 1df1d68f6d..e1b4763582 100644 --- a/daemon/execdriver/lxc/driver.go +++ b/daemon/execdriver/lxc/driver.go @@ -9,6 +9,7 @@ import ( "os/exec" "path" "path/filepath" + "runtime" "strconv" "strings" "syscall" @@ -26,6 +27,7 @@ const DriverName = "lxc" func init() { execdriver.RegisterInitFunc(DriverName, func(args *execdriver.InitArgs) error { + runtime.LockOSThread() if err := setupEnv(args); err != nil { return err }