Skip to content

Commit f7fa009

Browse files
Merge pull request #25661 from Luap99/common-buildah
update c/{common,buildah} + selinux upgrade fixes
2 parents f0395f7 + f5fbb42 commit f7fa009

File tree

36 files changed

+71
-10199
lines changed

36 files changed

+71
-10199
lines changed

go.mod

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ require (
1313
github.com/checkpoint-restore/checkpointctl v1.3.0
1414
github.com/checkpoint-restore/go-criu/v7 v7.2.0
1515
github.com/containernetworking/plugins v1.6.2
16-
github.com/containers/buildah v1.39.1-0.20250321123219-bc4d7eb70fe3
17-
github.com/containers/common v0.62.3-0.20250321171839-dbeb17e40c80
16+
github.com/containers/buildah v1.39.1-0.20250324153001-6d9381d08265
17+
github.com/containers/common v0.62.3-0.20250324121725-e360699fb3e3
1818
github.com/containers/conmon v2.0.20+incompatible
1919
github.com/containers/gvisor-tap-vsock v0.8.5
2020
github.com/containers/image/v5 v5.34.3-0.20250311194052-d84dbab374e7
@@ -60,7 +60,7 @@ require (
6060
github.com/opencontainers/image-spec v1.1.1
6161
github.com/opencontainers/runtime-spec v1.2.1
6262
github.com/opencontainers/runtime-tools v0.9.1-0.20241108202711-f7e3563b0271
63-
github.com/opencontainers/selinux v1.11.1
63+
github.com/opencontainers/selinux v1.12.0
6464
github.com/openshift/imagebuilder v1.2.16-0.20250220150830-7ebfb09d364e
6565
github.com/rootless-containers/rootlesskit/v2 v2.3.2
6666
github.com/shirou/gopsutil/v4 v4.25.2
@@ -81,7 +81,7 @@ require (
8181
gopkg.in/inf.v0 v0.9.1
8282
gopkg.in/yaml.v3 v3.0.1
8383
sigs.k8s.io/yaml v1.4.0
84-
tags.cncf.io/container-device-interface v1.0.0
84+
tags.cncf.io/container-device-interface v1.0.1
8585
)
8686

8787
require (
@@ -232,6 +232,5 @@ require (
232232
google.golang.org/grpc v1.70.0 // indirect
233233
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
234234
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
235-
gopkg.in/yaml.v2 v2.4.0 // indirect
236235
tags.cncf.io/container-device-interface/specs-go v1.0.0 // indirect
237236
)

go.sum

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ github.com/containernetworking/cni v1.2.3 h1:hhOcjNVUQTnzdRJ6alC5XF+wd9mfGIUaj8F
7676
github.com/containernetworking/cni v1.2.3/go.mod h1:DuLgF+aPd3DzcTQTtp/Nvl1Kim23oFKdm2okJzBQA5M=
7777
github.com/containernetworking/plugins v1.6.2 h1:pqP8Mq923TLyef5g97XfJ/xpDeVek4yF8A4mzy9Tc4U=
7878
github.com/containernetworking/plugins v1.6.2/go.mod h1:SP5UG3jDO9LtmfbBJdP+nl3A1atOtbj2MBOYsnaxy64=
79-
github.com/containers/buildah v1.39.1-0.20250321123219-bc4d7eb70fe3 h1:F5qpz8HsQ/nxhArveDEgskbyOjFuSsEahevt4JHAePQ=
80-
github.com/containers/buildah v1.39.1-0.20250321123219-bc4d7eb70fe3/go.mod h1:kCk5Le5CiMazPfGhF8yg43LQa1YLKqBZNnI4PTq+W/U=
81-
github.com/containers/common v0.62.3-0.20250321171839-dbeb17e40c80 h1:U605lFaEyA0zsy4+gqZxth9V2Dl1UXBfcamA3cnQ33E=
82-
github.com/containers/common v0.62.3-0.20250321171839-dbeb17e40c80/go.mod h1:IW8fUkTIwJkeclyROeASOV5FvFBpHjtQj/XBXffhuBk=
79+
github.com/containers/buildah v1.39.1-0.20250324153001-6d9381d08265 h1:3cFRoMP4Up4sN/f2TOcCKSxiX/mbHCN5FwqHc+rw2B8=
80+
github.com/containers/buildah v1.39.1-0.20250324153001-6d9381d08265/go.mod h1:8DuzWORynpU4q7coSL0aElpPVMDZFoCOnz9gzqU8Ics=
81+
github.com/containers/common v0.62.3-0.20250324121725-e360699fb3e3 h1:+bpRXBlU6CBT1PeA5CJ0Yvc6M6jDyWb6Szja+wN3KBo=
82+
github.com/containers/common v0.62.3-0.20250324121725-e360699fb3e3/go.mod h1:n5C1/ox2S2r/5fcklbCkSV7Y++je/Rz+953Ecmhrnv4=
8383
github.com/containers/conmon v2.0.20+incompatible h1:YbCVSFSCqFjjVwHTPINGdMX1F6JXHGTUje2ZYobNrkg=
8484
github.com/containers/conmon v2.0.20+incompatible/go.mod h1:hgwZ2mtuDrppv78a/cOBNiCm6O0UMWGx1mu7P00nu5I=
8585
github.com/containers/gvisor-tap-vsock v0.8.5 h1:s7PA8znsZ4mamev5nNLsQqduYSlz1Ze5TWjfXnAfpEs=
@@ -404,8 +404,8 @@ github.com/opencontainers/runtime-spec v1.2.1 h1:S4k4ryNgEpxW1dzyqffOmhI1BHYcjzU
404404
github.com/opencontainers/runtime-spec v1.2.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
405405
github.com/opencontainers/runtime-tools v0.9.1-0.20241108202711-f7e3563b0271 h1:TPj0pMLCTy1CKwmrat3hqTxoZfqOuTy0asG0ccpGk8Q=
406406
github.com/opencontainers/runtime-tools v0.9.1-0.20241108202711-f7e3563b0271/go.mod h1:oIH6VwKkaDOO+SIYZpdwrC/0wKYqrfO6E1sG1j3UVws=
407-
github.com/opencontainers/selinux v1.11.1 h1:nHFvthhM0qY8/m+vfhJylliSshm8G1jJ2jDMcgULaH8=
408-
github.com/opencontainers/selinux v1.11.1/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec=
407+
github.com/opencontainers/selinux v1.12.0 h1:6n5JV4Cf+4y0KNXW48TLj5DwfXpvWlxXplUkdTrmPb8=
408+
github.com/opencontainers/selinux v1.12.0/go.mod h1:BTPX+bjVbWGXw7ZZWUbdENt8w0htPSrlgOOysQaU62U=
409409
github.com/openshift/imagebuilder v1.2.16-0.20250220150830-7ebfb09d364e h1:yKNaeGlH4+h06lkADFa5rAIG7ifxOiV04kLRCL0rct8=
410410
github.com/openshift/imagebuilder v1.2.16-0.20250220150830-7ebfb09d364e/go.mod h1:cK6MLyBl1IHmIYGLY/2SLOG6p0PtEDUOC7khxsFYUXE=
411411
github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
@@ -754,8 +754,6 @@ gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST
754754
gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc=
755755
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
756756
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
757-
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
758-
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
759757
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
760758
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
761759
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
@@ -771,7 +769,7 @@ sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
771769
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
772770
src.elv.sh v0.16.0-rc1.0.20220116211855-fda62502ad7f h1:pjVeIo9Ba6K1Wy+rlwX91zT7A+xGEmxiNRBdN04gDTQ=
773771
src.elv.sh v0.16.0-rc1.0.20220116211855-fda62502ad7f/go.mod h1:kPbhv5+fBeUh85nET3wWhHGUaUQ64nZMJ8FwA5v5Olg=
774-
tags.cncf.io/container-device-interface v1.0.0 h1:fbwPQiWZNpXUb9Os6t6JW52rsOppTFUbeJOpNtN1TmI=
775-
tags.cncf.io/container-device-interface v1.0.0/go.mod h1:mmi2aRGmOjK/6NR3TXjLpEIarOJ9qwgZjQ3nTIRwAaA=
772+
tags.cncf.io/container-device-interface v1.0.1 h1:KqQDr4vIlxwfYh0Ed/uJGVgX+CHAkahrgabg6Q8GYxc=
773+
tags.cncf.io/container-device-interface v1.0.1/go.mod h1:JojJIOeW3hNbcnOH2q0NrWNha/JuHoDZcmYxAZwb2i0=
776774
tags.cncf.io/container-device-interface/specs-go v1.0.0 h1:8gLw29hH1ZQP9K1YtAzpvkHCjjyIxHZYzBAvlQ+0vD8=
777775
tags.cncf.io/container-device-interface/specs-go v1.0.0/go.mod h1:u86hoFWqnh3hWz3esofRFKbI261bUlvUfLKGrDhJkgQ=

libpod/container_internal_common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3081,7 +3081,7 @@ func (c *Container) relabel(src, mountLabel string, shared bool) error {
30813081
}
30823082
// only relabel on initial creation of container
30833083
if !c.ensureState(define.ContainerStateConfigured, define.ContainerStateUnknown) {
3084-
label, err := label.FileLabel(src)
3084+
label, err := selinux.FileLabel(src)
30853085
if err != nil {
30863086
return err
30873087
}

libpod/oci_conmon_linux.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
runcconfig "github.com/opencontainers/cgroups"
2323
devices "github.com/opencontainers/cgroups/devices/config"
2424
spec "github.com/opencontainers/runtime-spec/specs-go"
25-
"github.com/opencontainers/selinux/go-selinux/label"
25+
"github.com/opencontainers/selinux/go-selinux"
2626
"github.com/sirupsen/logrus"
2727
"golang.org/x/sys/unix"
2828
)
@@ -147,13 +147,13 @@ func (r *ConmonOCIRuntime) createRootlessContainer(ctr *Container, restoreOption
147147
// Run the closure with the container's socket label set
148148
func (r *ConmonOCIRuntime) withContainerSocketLabel(ctr *Container, closure func() error) error {
149149
runtime.LockOSThread()
150-
if err := label.SetSocketLabel(ctr.ProcessLabel()); err != nil {
150+
if err := selinux.SetSocketLabel(ctr.ProcessLabel()); err != nil {
151151
return err
152152
}
153153
err := closure()
154154
// Ignore error returned from SetSocketLabel("") call,
155155
// can't recover.
156-
if labelErr := label.SetSocketLabel(""); labelErr == nil {
156+
if labelErr := selinux.SetSocketLabel(""); labelErr == nil {
157157
// Unlock the thread only if the process label could be restored
158158
// successfully. Otherwise leave the thread locked and the Go runtime
159159
// will terminate it once it returns to the threads pool.

libpod/util_linux.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"github.com/containers/podman/v5/pkg/rootless"
1515
"github.com/containers/storage/pkg/fileutils"
1616
spec "github.com/opencontainers/runtime-spec/specs-go"
17+
"github.com/opencontainers/selinux/go-selinux"
1718
"github.com/opencontainers/selinux/go-selinux/label"
1819
"github.com/sirupsen/logrus"
1920
"golang.org/x/sys/unix"
@@ -128,7 +129,7 @@ func assembleSystemdCgroupName(baseSlice, newSlice string) (string, string, erro
128129

129130
var lvpRelabel = label.Relabel
130131
var lvpInitLabels = label.InitLabels
131-
var lvpReleaseLabel = label.ReleaseLabel
132+
var lvpReleaseLabel = selinux.ReleaseLabel
132133

133134
// LabelVolumePath takes a mount path for a volume and gives it an
134135
// selinux label of either shared or not
@@ -139,9 +140,7 @@ func LabelVolumePath(path, mountLabel string) error {
139140
if err != nil {
140141
return fmt.Errorf("getting default mountlabels: %w", err)
141142
}
142-
if err := lvpReleaseLabel(mountLabel); err != nil {
143-
return fmt.Errorf("releasing label %q: %w", mountLabel, err)
144-
}
143+
lvpReleaseLabel(mountLabel)
145144
}
146145

147146
if err := lvpRelabel(path, mountLabel, true); err != nil {

libpod/util_linux_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ func TestLabelVolumePath(t *testing.T) {
3131
mLabel := "system_u:object_r:container_file_t:s0:c1,c2"
3232
return pLabel, mLabel, nil
3333
}
34-
lvpReleaseLabel = func(label string) error {
35-
return nil
36-
}
34+
lvpReleaseLabel = func(label string) {}
3735

3836
// LabelVolumePath should not return an error if the operation is unsupported.
3937
err := LabelVolumePath("/foo/bar", "")

pkg/specgen/generate/container_create.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"github.com/containers/podman/v5/pkg/specgenutil"
2323
"github.com/containers/podman/v5/pkg/util"
2424
"github.com/opencontainers/runtime-spec/specs-go"
25-
"github.com/opencontainers/selinux/go-selinux/label"
25+
"github.com/opencontainers/selinux/go-selinux"
2626
"github.com/sirupsen/logrus"
2727
"tags.cncf.io/container-device-interface/pkg/parser"
2828
)
@@ -578,7 +578,7 @@ func createContainerOptions(rt *libpod.Runtime, s *specgen.SpecGenerator, pod *l
578578
return nil, err
579579
}
580580
if processLabel != "" {
581-
selinuxOpts, err := label.DupSecOpt(processLabel)
581+
selinuxOpts, err := selinux.DupSecOpt(processLabel)
582582
if err != nil {
583583
return nil, err
584584
}

pkg/specgen/generate/security_linux.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,41 +16,41 @@ import (
1616
"github.com/containers/podman/v5/pkg/specgen"
1717
"github.com/containers/podman/v5/pkg/util"
1818
"github.com/opencontainers/runtime-tools/generate"
19-
"github.com/opencontainers/selinux/go-selinux/label"
19+
"github.com/opencontainers/selinux/go-selinux"
2020
"github.com/sirupsen/logrus"
2121
)
2222

2323
// setLabelOpts sets the label options of the SecurityConfig according to the
2424
// input.
2525
func setLabelOpts(s *specgen.SpecGenerator, runtime *libpod.Runtime, pidConfig specgen.Namespace, ipcConfig specgen.Namespace) error {
2626
if !runtime.EnableLabeling() || s.IsPrivileged() {
27-
s.SelinuxOpts = label.DisableSecOpt()
27+
s.SelinuxOpts = selinux.DisableSecOpt()
2828
return nil
2929
}
3030

3131
var labelOpts []string
3232
if pidConfig.IsHost() {
33-
labelOpts = append(labelOpts, label.DisableSecOpt()...)
33+
labelOpts = append(labelOpts, selinux.DisableSecOpt()...)
3434
} else if pidConfig.IsContainer() {
3535
ctr, err := runtime.LookupContainer(pidConfig.Value)
3636
if err != nil {
3737
return fmt.Errorf("container %q not found: %w", pidConfig.Value, err)
3838
}
39-
secopts, err := label.DupSecOpt(ctr.ProcessLabel())
39+
secopts, err := selinux.DupSecOpt(ctr.ProcessLabel())
4040
if err != nil {
4141
return fmt.Errorf("failed to duplicate label %q : %w", ctr.ProcessLabel(), err)
4242
}
4343
labelOpts = append(labelOpts, secopts...)
4444
}
4545

4646
if ipcConfig.IsHost() {
47-
labelOpts = append(labelOpts, label.DisableSecOpt()...)
47+
labelOpts = append(labelOpts, selinux.DisableSecOpt()...)
4848
} else if ipcConfig.IsContainer() {
4949
ctr, err := runtime.LookupContainer(ipcConfig.Value)
5050
if err != nil {
5151
return fmt.Errorf("container %q not found: %w", ipcConfig.Value, err)
5252
}
53-
secopts, err := label.DupSecOpt(ctr.ProcessLabel())
53+
secopts, err := selinux.DupSecOpt(ctr.ProcessLabel())
5454
if err != nil {
5555
return fmt.Errorf("failed to duplicate label %q : %w", ctr.ProcessLabel(), err)
5656
}

vendor/github.com/containers/buildah/chroot/selinux.go

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

vendor/github.com/containers/buildah/imagebuildah/build.go

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

vendor/github.com/containers/buildah/util.go

Lines changed: 2 additions & 4 deletions
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/label/label.go

Lines changed: 0 additions & 67 deletions
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/label/label_linux.go

Lines changed: 0 additions & 11 deletions
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/label/label_stub.go

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

0 commit comments

Comments
 (0)