Skip to content

Commit

Permalink
Mask over the /sys/fs/selinux in mask branch
Browse files Browse the repository at this point in the history
This is required so that the mount point shows up when buildah
is vendored into Podman.

Signed-off-by: Daniel J Walsh <[email protected]>
Signed-off-by: TomSweeneyRedHat <[email protected]>
  • Loading branch information
rhatdan authored and TomSweeneyRedHat committed Jul 29, 2020
1 parent 4c52b9e commit cd67d69
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env:
#### Global variables used for all tasks
####
# Name of the ultimate destination branch for this CI run, PR or post-merge.
DEST_BRANCH: "master"
DEST_BRANCH: "release-1.15"
GOPATH: "/var/tmp/go"
GOSRC: "${GOPATH}/src/github.com/containers/buildah"
# Overrides default location (/tmp/cirrus) for repo clone
Expand Down
2 changes: 0 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
vendor golang.org/x/[email protected]
Cirrus: Fix missing htpasswd in registry img
Switch scripts to use containers.conf
Merge pull request #2471 from vrothberg/1.15-update-x/text
Make imagebuildah.BuildOptions.Architecture/OS optional
Merge pull request #2483 from nalind/release-1.15-arch

## v1.15.0 (2020-06-17)
Bump github.com/containers/common from 0.12.0 to 0.13.1
Expand Down
2 changes: 0 additions & 2 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
* vendor golang.org/x/[email protected]
* Cirrus: Fix missing htpasswd in registry img
* Switch scripts to use containers.conf
* Merge pull request #2471 from vrothberg/1.15-update-x/text
* Make imagebuildah.BuildOptions.Architecture/OS optional
* Merge pull request #2483 from nalind/release-1.15-arch

- Changelog for v1.15.0 (2020-06-17)
* Bump github.com/containers/common from 0.12.0 to 0.13.1
Expand Down
4 changes: 0 additions & 4 deletions chroot/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -1106,10 +1106,6 @@ func setupChrootBindMounts(spec *specs.Spec, bundlePath string) (undoBinds func(
}
logrus.Debugf("bind mounted %q to %q", "/sys", filepath.Join(spec.Root.Path, "/sys"))

// Add /sys/fs/selinux to the set of masked paths, to ensure that we don't have processes
// attempting to interact with labeling, when they aren't allowed to do so.
spec.Linux.MaskedPaths = append(spec.Linux.MaskedPaths, "/sys/fs/selinux")

// Bind mount in everything we've been asked to mount.
for _, m := range spec.Mounts {
// Skip anything that we just mounted.
Expand Down
2 changes: 0 additions & 2 deletions contrib/rpm/buildah.spec
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ make DESTDIR=%{buildroot} PREFIX=%{_prefix} install install.completions
- vendor golang.org/x/[email protected]
- Cirrus: Fix missing htpasswd in registry img
- Switch scripts to use containers.conf
- Merge pull request #2471 from vrothberg/1.15-update-x/text
- Make imagebuildah.BuildOptions.Architecture/OS optional
- Merge pull request #2483 from nalind/release-1.15-arch

* Wed Jun 17, 2020 Tom Sweeney <[email protected]> 1.15.0-1
- Bump github.com/containers/common from 0.12.0 to 0.13.1
Expand Down
6 changes: 2 additions & 4 deletions run_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -1779,6 +1779,7 @@ func setupMaskedPaths(g *generate.Generator) {
"/proc/sched_debug",
"/proc/scsi",
"/sys/firmware",
"/sys/fs/selinux",
} {
g.AddLinuxMaskedPaths(mp)
}
Expand Down Expand Up @@ -2023,13 +2024,10 @@ func setupRootlessSpecChanges(spec *specs.Spec, bundleDir string, shmSize string
Options: []string{bind.NoBindOption, "rbind", "private", "nodev", "noexec", "nosuid", "ro"},
},
}
// Cover up /sys/fs/cgroup and /sys/fs/selinux, if they exist in our source for /sys.
// Cover up /sys/fs/cgroup, if it exist in our source for /sys.
if _, err := os.Stat("/sys/fs/cgroup"); err == nil {
spec.Linux.MaskedPaths = append(spec.Linux.MaskedPaths, "/sys/fs/cgroup")
}
if _, err := os.Stat("/sys/fs/selinux"); err == nil {
spec.Linux.MaskedPaths = append(spec.Linux.MaskedPaths, "/sys/fs/selinux")
}
// Keep anything that isn't under /dev, /proc, or /sys.
for i := range spec.Mounts {
if spec.Mounts[i].Destination == "/dev" || strings.HasPrefix(spec.Mounts[i].Destination, "/dev/") ||
Expand Down
3 changes: 2 additions & 1 deletion tests/validate/git-validation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ fi

if [[ "$TRAVIS" != 'true' ]]; then
#GITVALIDATE_EPOCH=":/git-validation epoch"
GITVALIDATE_EPOCH="c5546750573cdef524be7159fe837f23274e9718"
# Set to the branch's origin point
GITVALIDATE_EPOCH="3b1d6ebe12445dfe84cb5932634440a20b10fc03"
fi

OUTPUT_OPTIONS="-q"
Expand Down

0 comments on commit cd67d69

Please sign in to comment.