Browse Source

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 <scanon@lbl.gov> (github: scanon)
Shane Canon 11 năm trước cách đây
mục cha
commit
f9705477d0
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      daemon/execdriver/lxc/driver.go

+ 2 - 0
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
 		}