Skip to content

Commit 8891c58

Browse files
authored
Merge pull request moby#41786 from thaJeztah/test_selinux_tip
vendor: opencontainers/selinux v1.8.0, and remove selinux build-tag and stubs
2 parents ffc4dc9 + 1c0af18 commit 8891c58

File tree

15 files changed

+14
-53
lines changed

15 files changed

+14
-53
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ARG SYSTEMD="false"
66
ARG GO_VERSION=1.13.15
77
ARG DEBIAN_FRONTEND=noninteractive
88
ARG VPNKIT_VERSION=0.4.0
9-
ARG DOCKER_BUILDTAGS="apparmor seccomp selinux"
9+
ARG DOCKER_BUILDTAGS="apparmor seccomp"
1010

1111
ARG BASE_DEBIAN_DISTRO="buster"
1212
ARG GOLANG_IMAGE="golang:${GO_VERSION}-${BASE_DEBIAN_DISTRO}"

daemon/daemon_unix.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import (
4545
lntypes "github.com/docker/libnetwork/types"
4646
"github.com/moby/sys/mount"
4747
specs "github.com/opencontainers/runtime-spec/specs-go"
48+
"github.com/opencontainers/selinux/go-selinux"
4849
"github.com/opencontainers/selinux/go-selinux/label"
4950
"github.com/pkg/errors"
5051
"github.com/sirupsen/logrus"
@@ -822,7 +823,7 @@ func overlaySupportsSelinux() (bool, error) {
822823
// configureKernelSecuritySupport configures and validates security support for the kernel
823824
func configureKernelSecuritySupport(config *config.Config, driverName string) error {
824825
if config.EnableSelinuxSupport {
825-
if !selinuxEnabled() {
826+
if !selinux.GetEnabled() {
826827
logrus.Warn("Docker could not enable SELinux on the host system")
827828
return nil
828829
}
@@ -840,7 +841,7 @@ func configureKernelSecuritySupport(config *config.Config, driverName string) er
840841
}
841842
}
842843
} else {
843-
selinuxSetDisabled()
844+
selinux.SetDisabled()
844845
}
845846
return nil
846847
}

daemon/delete.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/docker/docker/container"
1212
"github.com/docker/docker/errdefs"
1313
"github.com/docker/docker/pkg/system"
14+
"github.com/opencontainers/selinux/go-selinux"
1415
"github.com/pkg/errors"
1516
"github.com/sirupsen/logrus"
1617
)
@@ -134,7 +135,7 @@ func (daemon *Daemon) cleanupContainer(container *container.Container, forceRemo
134135
}
135136

136137
linkNames := daemon.linkIndex.delete(container)
137-
selinuxFreeLxcContexts(container.ProcessLabel)
138+
selinux.ReleaseLabel(container.ProcessLabel)
138139
daemon.idIndex.Delete(container.ID)
139140
daemon.containers.Delete(container.ID)
140141
daemon.containersReplica.Delete(container)

daemon/info.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"github.com/docker/docker/pkg/system"
2323
"github.com/docker/docker/registry"
2424
metrics "github.com/docker/go-metrics"
25+
"github.com/opencontainers/selinux/go-selinux"
2526
"github.com/sirupsen/logrus"
2627
)
2728

@@ -188,7 +189,7 @@ func (daemon *Daemon) fillSecurityOptions(v *types.Info, sysInfo *sysinfo.SysInf
188189
}
189190
securityOptions = append(securityOptions, fmt.Sprintf("name=seccomp,profile=%s", profile))
190191
}
191-
if selinuxEnabled() {
192+
if selinux.GetEnabled() {
192193
securityOptions = append(securityOptions, "name=selinux")
193194
}
194195
if rootIDs := daemon.idMapping.RootPair(); rootIDs.UID != 0 || rootIDs.GID != 0 {

daemon/selinux_linux.go

Lines changed: 0 additions & 15 deletions
This file was deleted.

daemon/selinux_unsupported.go

Lines changed: 0 additions & 13 deletions
This file was deleted.

project/PACKAGERS.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,6 @@ AppArmor, you will need to set `DOCKER_BUILDTAGS` as follows:
156156
export DOCKER_BUILDTAGS='apparmor'
157157
```
158158

159-
If you're building a binary that may need to be used on platforms that include
160-
SELinux, you will need to use the `selinux` build tag:
161-
```bash
162-
export DOCKER_BUILDTAGS='selinux'
163-
```
164-
165159
If you're building a binary that may need to be used on platforms that include
166160
seccomp, you will need to use the `seccomp` build tag:
167161
```bash
@@ -188,7 +182,7 @@ export DOCKER_BUILDTAGS='exclude_graphdriver_aufs'
188182

189183
NOTE: if you need to set more than one build tag, space separate them:
190184
```bash
191-
export DOCKER_BUILDTAGS='apparmor selinux exclude_graphdriver_aufs'
185+
export DOCKER_BUILDTAGS='apparmor exclude_graphdriver_aufs'
192186
```
193187

194188
### LCOW (Linux Containers On Windows)

vendor.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ github.com/morikuni/aec 39771216ff4c63d11f5e604076f9
176176
# metrics
177177
github.com/docker/go-metrics b619b3592b65de4f087d9f16863a7e6ff905973c # v0.0.1
178178

179-
github.com/opencontainers/selinux 63ad55b76fd78d4c76c2f5491f68516e60c9d523 # v1.7.0
179+
github.com/opencontainers/selinux 2f45b3796d18f1ab4c9fc0c888a98d0a0fd6e429 # v1.8.0
180180
github.com/willf/bitset 559910e8471e48d76d9e5a1ba15842dee77ad45d # v1.1.11
181181

182182

vendor/github.com/opencontainers/selinux/README.md

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/opencontainers/selinux/go-selinux/doc.go

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)