Skip to content

Commit

Permalink
Merge pull request opencontainers#137 from mrunalp/revert_cgroup_ro
Browse files Browse the repository at this point in the history
Revert "Remount /sys/fs/cgroup as readonly always"
  • Loading branch information
LK4D4 committed Jul 17, 2015
2 parents 618e0ca + 5b80527 commit 1eeb86f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
18 changes: 0 additions & 18 deletions libcontainer/integration/exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -845,15 +845,6 @@ func TestMountCgroupRO(t *testing.T) {
mountInfo := buffers.Stdout.String()
lines := strings.Split(mountInfo, "\n")
for _, l := range lines {
if strings.HasPrefix(l, "tmpfs on /sys/fs/cgroup") {
if !strings.Contains(l, "ro,nosuid,nodev,noexec") {
t.Fatalf("Mode expected to contain 'ro,nosuid,nodev,noexec': %s", l)
}
if !strings.Contains(l, "mode=755") {
t.Fatalf("Mode expected to contain 'mode=755': %s", l)
}
continue
}
if !strings.HasPrefix(l, "cgroup") {
continue
}
Expand Down Expand Up @@ -889,15 +880,6 @@ func TestMountCgroupRW(t *testing.T) {
mountInfo := buffers.Stdout.String()
lines := strings.Split(mountInfo, "\n")
for _, l := range lines {
if strings.HasPrefix(l, "tmpfs on /sys/fs/cgroup") {
if !strings.Contains(l, "ro,nosuid,nodev,noexec") {
t.Fatalf("Mode expected to contain 'ro,nosuid,nodev,noexec': %s", l)
}
if !strings.Contains(l, "mode=755") {
t.Fatalf("Mode expected to contain 'mode=755': %s", l)
}
continue
}
if !strings.HasPrefix(l, "cgroup") {
continue
}
Expand Down
6 changes: 0 additions & 6 deletions libcontainer/rootfs_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ func mountToRootfs(m *configs.Mount, rootfs, mountLabel string) error {
Device: "tmpfs",
Destination: m.Destination,
Flags: defaultMountFlags,
Data: "mode=755",
}
if err := mountToRootfs(tmpfs, rootfs, mountLabel); err != nil {
return err
Expand All @@ -206,11 +205,6 @@ func mountToRootfs(m *configs.Mount, rootfs, mountLabel string) error {
return err
}
}
// remount cgroup root as readonly
rootfsCgroup := filepath.Join(rootfs, m.Destination)
if err := syscall.Mount("", rootfsCgroup, "", defaultMountFlags|syscall.MS_REMOUNT|syscall.MS_RDONLY, ""); err != nil {
return err
}
default:
return fmt.Errorf("unknown mount device %q to %q", m.Device, m.Destination)
}
Expand Down

0 comments on commit 1eeb86f

Please sign in to comment.