Skip to content

[1.4] ci: fix govulncheck and check-go jobs; fix sub-cgroup path check - #5583

Merged
lifubang merged 5 commits into
opencontainers:release-1.4from
kolyshkin:1.4-5403
Nov 3, 2026
Merged

lifubang merged 5 commits into
opencontainers:release-1.4from
kolyshkin:1.4-5403

Conversation

@kolyshkin

@kolyshkin kolyshkin commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

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 and
    1.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
    go directive in go.mod is 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_CLOEXEC fix. 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 --cgroup
sub-cgroup path check.

🚩 WARNING: this bumps oc/cgroups from v0.0.6 to v0.1.0.

@kolyshkin kolyshkin added easy-to-review backport/1.4-pr A backport PR to release-1.4 labels Oct 27, 2026
@kolyshkin kolyshkin added this to the 1.4.4 milestone Oct 27, 2026
@kolyshkin kolyshkin changed the title [1.4] libct: fix sub-cgroup path check [1.4] ci: fix govulncheck and check-go jobs; fix sub-cgroup path check Oct 27, 2026

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kolyshkin

Copy link
Copy Markdown
Contributor Author

@opencontainers/runc-maintainers this needs a second LGTM (and will make 1.4 CI green again)

lifubang and others added 5 commits October 31, 2026 13:24
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>
@kolyshkin

Copy link
Copy Markdown
Contributor Author

Needs a second lgtm; PTAL @rata @AkihiroSuda @lifubang

@lifubang
lifubang merged commit 176969f into opencontainers:release-1.4 Nov 3, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants