Repository navigation
[1.4] ci: fix govulncheck and check-go jobs; fix sub-cgroup path check - #5583
Merged
Merged
Conversation
This was referenced Oct 27, 2026
Contributor
Author
|
@opencontainers/runc-maintainers this needs a second LGTM (and will make 1.4 CI green again) |
kolyshkin
force-pushed
the
1.4-5403
branch
2 times, most recently
from
October 31, 2026 20:21
d0467e0 to
a3910b8
Compare
Adapt to the updated `cgroups.Manager` interface: // Stats returns statistics for specified controllers. Stats(opts *StatsOptions) (*Stats, error) Signed-off-by: lifubang <lifubang@acmcoder.com> (cherry picked from commit 3e92f3f) Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
See https://github.com/opencontainers/cgroups/releases/tag/v0.1.0 Notably, it no longer uses the high-level cilium/ebpf API (btf, link, and the ELF loader) to manage cgroup v2 device rules, which makes the runc binary about 1 MiB (7.5%) smaller on amd64, removes ~20K lines of vendored code, and drops five transitive dependencies (josharian/native, jsimonetti/rtnetlink, mdlayher/netlink, mdlayher/socket, golang.org/x/sync). Assisted-by: Claude Opus 5 (cherry picked from commit 0ab7327) Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Go 1.25 is no longer supported upstream (go.dev/dl only lists 1.27 and 1.26 now), which makes the validate.yml check-go job fail: Go version used in Dockerfile: 1.25 Checking if Go 1.25 is supported ... false Drop 1.24.x and 1.25.x from the test matrix, add 1.27.x, and move the criu-dev and -race excludes over to 1.26.x (they are meant to skip the oldest tested version). Bump Dockerfile and validate.yml to Go 1.26 accordingly. Unlike the original commit, the minimum Go version in go.mod is not raised, as this is a release branch and we do not want to break builds with the Go toolchain that 1.4.x has been requiring so far. Assisted-by: Claude Opus 5 (cherry picked from commit f379cdf) Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
The check that a sub-cgroup path (as set by runc exec --cgroup, or libcontainer's Process.SubCgroupPaths) does not escape the container's cgroup was too lax: a plain prefix check also accepts a sibling cgroup whose name starts with the container cgroup name (say, "../foo-suffix" for a container cgroup named "foo"). For addIntoCgroupV1 (used for per-controller sub-cgroup paths, which AddPid does not support) the resulting path is passed to WriteCgroupProc as is, so the pid did end up in the sibling cgroup. For prepareCgroupFD the subsequent cgroups.OpenFile call cleans the path, so nothing escaped in practice, but the check was wrong nevertheless. Use the same check as opencontainers/cgroups v0.0.9 does in AddPid, and add test cases for both code paths. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> Assisted-by: Claude Opus 5 (cherry picked from commit 7820c58) Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> (cherry picked from commit c689588) Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Contributor
Author
|
Needs a second lgtm; PTAL @rata @AkihiroSuda @lifubang |
lifubang
approved these changes
Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #5380, #5413 (partial), #5341 (partial) and #5403 to
release-1.4, to make CI green again and fix the sub-cgroup path check.This is the 1.4 counterpart of #5428 and #5457.
Two jobs are currently red on release-1.4:
check-go: Go 1.25 is no longer listed by go.dev/dl, so the job fails with
Checking if Go 1.25 is supported ... false. Fixed by dropping 1.24.x and1.25.x from the test matrix, adding 1.27.x, and bumping the
Dockerfile/validate.yml Go version to 1.26. Unlike the original commit, the
godirective ingo.modis not raised (it stays at 1.24.0).govulncheck: GO-2026-6238 (integer overflow in BTF parsing in
cilium/ebpf). Fixed (same as main and release-1.5) by switching to
opencontainers/cgroups v0.1.0, which no longer uses the high-level
cilium/ebpf API, so the vulnerable symbols are no longer linked in. That bump
requires the intermediate v0.0.8 bump, so both commits are included.
As a bonus, cgroups v0.1.0 carries a workaround for a kernel bug (v6.17+)
that caused memory corruption in runc when configuring cgroup v2 device
rules, plus a missing
O_CLOEXECfix. CHANGELOG updated accordingly.Since golangci-lint v2.6 used on release-1.4 is too old for Go 1.26, it is
bumped to v2.12 (same as release-1.5), from #5341. No new warnings.
Also included is 7820c58 from #5403, improving the
runc exec --cgroupsub-cgroup path check.
🚩 WARNING: this bumps oc/cgroups from v0.0.6 to v0.1.0.