Codebase list golang-github-containers-buildah / c00b434
Mask over the /sys/fs/selinux in mask branch This is required so that the mount point shows up when buildah is vendored into Podman. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Daniel J Walsh 3 years ago
2 changed file(s) with 2 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
11001100 }
11011101 logrus.Debugf("bind mounted %q to %q", "/sys", filepath.Join(spec.Root.Path, "/sys"))
11021102
1103 // Add /sys/fs/selinux to the set of masked paths, to ensure that we don't have processes
1104 // attempting to interact with labeling, when they aren't allowed to do so.
1105 spec.Linux.MaskedPaths = append(spec.Linux.MaskedPaths, "/sys/fs/selinux")
1106
11071103 // Bind mount in everything we've been asked to mount.
11081104 for _, m := range spec.Mounts {
11091105 // Skip anything that we just mounted.
17781778 "/proc/sched_debug",
17791779 "/proc/scsi",
17801780 "/sys/firmware",
1781 "/sys/fs/selinux",
17811782 } {
17821783 g.AddLinuxMaskedPaths(mp)
17831784 }
20222023 Options: []string{bind.NoBindOption, "rbind", "private", "nodev", "noexec", "nosuid", "ro"},
20232024 },
20242025 }
2025 // Cover up /sys/fs/cgroup and /sys/fs/selinux, if they exist in our source for /sys.
2026 // Cover up /sys/fs/cgroup, if it exist in our source for /sys.
20262027 if _, err := os.Stat("/sys/fs/cgroup"); err == nil {
20272028 spec.Linux.MaskedPaths = append(spec.Linux.MaskedPaths, "/sys/fs/cgroup")
2028 }
2029 if _, err := os.Stat("/sys/fs/selinux"); err == nil {
2030 spec.Linux.MaskedPaths = append(spec.Linux.MaskedPaths, "/sys/fs/selinux")
20312029 }
20322030 // Keep anything that isn't under /dev, /proc, or /sys.
20332031 for i := range spec.Mounts {