Skip to content

Commit 4a34184

Browse files
committed
Update runc to 89c3c97a8482f3a57cd4bb683df1a7b2c61405d8
Fixes adamlaska#211 Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
1 parent c0a78ae commit 4a34184

File tree

5 files changed

+19
-8
lines changed

5 files changed

+19
-8
lines changed

hack/vendor.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ clone git github.com/docker/go-units 5d2041e26a699eaca682e2ea41c8f891e1060444
1414
clone git github.com/godbus/dbus e2cf28118e66a6a63db46cf6088a35d2054d3bb0
1515
clone git github.com/golang/glog 23def4e6c14b4da8ac2ed8007337bc5eb5007998
1616
clone git github.com/golang/protobuf 8d92cf5fc15a4382f8964b08e1f42a75c0591aa3
17-
clone git github.com/opencontainers/runc 9c89737e6e117a8be5a4980bc9795fe1a2b1028e
17+
clone git github.com/opencontainers/runc 89c3c97a8482f3a57cd4bb683df1a7b2c61405d8
1818
clone git github.com/opencontainers/runtime-spec f955d90e70a98ddfb886bd930ffd076da9b67998
1919
clone git github.com/rcrowley/go-metrics eeba7bd0dd01ace6e690fa833b3f22aaec29af43
2020
clone git github.com/satori/go.uuid f9ab0dce87d815821e221626b772e3475a0d2749

vendor/src/github.com/opencontainers/runc/libcontainer/cgroups/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818

1919
const cgroupNamePrefix = "name="
2020

21-
// https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt
21+
// https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt
2222
func FindCgroupMountpoint(subsystem string) (string, error) {
2323
// We are not using mount.GetMounts() because it's super-inefficient,
2424
// parsing it directly sped up x10 times because of not using Sscanf.

vendor/src/github.com/opencontainers/runc/libcontainer/rootfs_linux.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ func setupRootfs(config *configs.Config, console *linuxConsole, pipe io.ReadWrit
6969
if err := setupDevSymlinks(config.Rootfs); err != nil {
7070
return newSystemErrorWithCause(err, "setting up /dev symlinks")
7171
}
72+
if err := label.Relabel(filepath.Join(config.Rootfs, "dev"), config.MountLabel, false); err != nil {
73+
return err
74+
}
7275
}
7376
// Signal the parent to run the pre-start hooks.
7477
// The hooks are run after the mounts are setup, but before we switch to the new

vendor/src/github.com/opencontainers/runc/libcontainer/selinux/selinux.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -486,14 +486,14 @@ func DupSecOpt(src string) []string {
486486
con["level"] == "" {
487487
return nil
488488
}
489-
return []string{"label:user:" + con["user"],
490-
"label:role:" + con["role"],
491-
"label:type:" + con["type"],
492-
"label:level:" + con["level"]}
489+
return []string{"label=user:" + con["user"],
490+
"label=role:" + con["role"],
491+
"label=type:" + con["type"],
492+
"label=level:" + con["level"]}
493493
}
494494

495495
// DisableSecOpt returns a security opt that can be used to disabling SELinux
496496
// labeling support for future container processes
497497
func DisableSecOpt() []string {
498-
return []string{"label:disable"}
498+
return []string{"label=disable"}
499499
}

vendor/src/github.com/opencontainers/runc/libcontainer/standard_init_linux.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,10 @@ func (l *linuxStandardInit) Init() error {
123123
if err := syncParentReady(l.pipe); err != nil {
124124
return err
125125
}
126-
if l.config.Config.Seccomp != nil {
126+
// Without NoNewPrivileges seccomp is a privileged operation, so we need to
127+
// do this before dropping capabilities; otherwise do it as late as possible
128+
// just before execve so as few syscalls take place after it as possible.
129+
if l.config.Config.Seccomp != nil && !l.config.NoNewPrivileges {
127130
if err := seccomp.InitSeccomp(l.config.Config.Seccomp); err != nil {
128131
return err
129132
}
@@ -142,6 +145,11 @@ func (l *linuxStandardInit) Init() error {
142145
if syscall.Getppid() != l.parentPid {
143146
return syscall.Kill(syscall.Getpid(), syscall.SIGKILL)
144147
}
148+
if l.config.Config.Seccomp != nil && l.config.NoNewPrivileges {
149+
if err := seccomp.InitSeccomp(l.config.Config.Seccomp); err != nil {
150+
return err
151+
}
152+
}
145153

146154
return system.Execv(l.config.Args[0], l.config.Args[0:], os.Environ())
147155
}

0 commit comments

Comments
 (0)