Commit Graph

6912 Commits

Author SHA1 Message Date
Kir Kolyshkin 40dd884a00 MAINTAINERS: add Rodrigo Campos
I am nominating @rata for the role of runc maintainer.

He is pretty active in the project, did some substantial work
and is helping with PR review and releases.

As noted in MAINTAINERS_GUIDE.md, we have a week to vote, and need to
get 66% of current maintainers' votes.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-07 14:23:14 -07:00
lfbzhm a4b0857529 Merge pull request #4188 from kolyshkin/ci-swap
tests/int: swap-related fixes
2024-06-07 22:03:31 +08:00
Kir Kolyshkin 3083bd443f tests/cgroups: separate cgroup v2 swap test
There are cgroup v2 systems out there that do not have cgroup swap enabled,
and this test will probably fail in there.

Move it to a separate case, guarded with requires cgroups_swap.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-06 18:52:34 +08:00
Kir Kolyshkin 4209439b5f libct/cg/fs/v2: ignore setting swap in some cases
When swap is being disabled (as set to 0), or set to max, ignore
non-existent memory.swap.max cgroup file.

If swap is being set explicitly to some value, do return an error like
before.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-06 18:52:34 +08:00
Kir Kolyshkin dbb011ecd9 tests/int/helpers: fix cgroups_swap check for v2
In case of cgroup v2, there's no memory.swap.max in the top-level
cgroup, so we have to use find.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-06 18:52:34 +08:00
Kir Kolyshkin 8626c7173e tests/int: fixup find statements
1. Add "-maxdepth 2" to not dive too deep into cgroup hierarchy.

2. Add "-type f" to look for a regular file.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-06 18:52:34 +08:00
Kir Kolyshkin e530b2a668 tests/int/update: fix v2 swap check
If swap is disabled, we should not run swap tests.

Fixes 4166.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-06 18:52:34 +08:00
Akihiro Suda 8fc5be4e60 Merge pull request #3908 from deitch/trimpath-optional
make trimpath optional
2024-06-06 11:23:09 +09:00
Avi Deitcher 024c2711f3 make trimpath optional
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2024-06-05 18:56:20 -07:00
lfbzhm 7cce7e2653 Merge pull request #4286 from kolyshkin/u24.04
ci/gha: switch to ubuntu 24.04
2024-06-05 18:32:09 +08:00
Kir Kolyshkin 67f6c37bc2 ci/gha: switch to ubuntu 24.04
Let's replace ubuntu-22.04 with ubuntu-24.04 where we can, and keep
ubuntu-20.04 to test cgroup v1 stuff.

Leave ubuntu-22.04 for ci/cross-i386 (issue with systemctl restart hang
after apt install). This can be addressed separately later.

The only kludge we have to add is enable userns for runc binary being
tested (as userns is disabled by apparmor system-wide by default now,
see [1]).

[1] https://discourse.ubuntu.com/t/ubuntu-24-04-lts-noble-numbat-release-notes/39890#unprivileged-user-namespace-restrictions-15

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-04 23:43:12 -07:00
Akihiro Suda 73bb57e9ab Merge pull request #4307 from kolyshkin/rm-cs8
ci/cirrus: rm centos stream 8
2024-06-05 14:04:11 +09:00
Kir Kolyshkin 40bb9c468e ci/cirrus: rm centos stream 8
It is past EOL and has been removed from GCE public images.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-04 18:19:33 -07:00
Akihiro Suda 3e8f48d215 Merge pull request #4304 from kolyshkin/cs8eol
ci: workaround for centos stream 8 being EOLed
2024-06-04 16:58:52 +09:00
Kir Kolyshkin 48c4e733f4 ci: workaround for centos stream 8 being EOLed
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-03 17:16:24 -07:00
lfbzhm 66379d9ef1 Merge pull request #4298 from kolyshkin/fixup-sched-test
tests/int/scheduler: require smp
2024-06-03 09:34:24 +08:00
lfbzhm 75c9f5cefc Merge pull request #4301 from kolyshkin/pin-codespell
ci: pin codespell
2024-06-03 09:02:35 +08:00
Kir Kolyshkin 5c5ebe772b tests/int/scheduler: require smp
This test case fails when there's a single CPU. Fix this by adding
"require smp".

While at it, document the test case and add a FIXME to maybe remove
this test later.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-02 11:02:40 -07:00
Kir Kolyshkin b24fc9d2c4 ci: pin codespell
CI should not fail and require attention every time a new codespell
version is released.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-02 10:51:43 -07:00
lfbzhm 854c4af3ba Merge pull request #4290 from kolyshkin/rlimit-rework
Rlimit cache rework for Go 1.23+
2024-06-02 06:03:44 +08:00
Kir Kolyshkin 584afc6756 libct/system: ClearRlimitNofileCache for go 1.23
Go 1.23 tightens access to internal symbols, and even puts runc into
"hall of shame" for using an internal symbol (recently added by commit
da68c8e3). So, while not impossible, it becomes harder to access those
internal symbols, and it is a bad idea in general.

Since Go 1.23 includes https://go.dev/cl/588076, we can clean the
internal rlimit cache by setting the RLIMIT_NOFILE for ourselves,
essentially disabling the rlimit cache.

Once Go 1.22 is no longer supported, we will remove the go:linkname hack.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-01 13:02:29 -07:00
Akihiro Suda ba4b52d372 Merge pull request #4295 from kolyshkin/fix-setv1-panic
libct/cg/dev: fix TestSetV1Allow panic
2024-06-02 02:13:36 +09:00
Akihiro Suda 94d255bca4 Merge pull request #4296 from kolyshkin/bookworm
Dockerfile: bump Debian to 12, Go to 1.21
2024-06-02 02:12:48 +09:00
Kir Kolyshkin b74b33c439 Dockerfile: bump Debian to 12, Go to 1.21
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-30 11:23:03 -07:00
Kir Kolyshkin d697725a4d libct/cg/dev: fix TestSetV1Allow panic
This test panics if userns is detected (such as when run in a rootless
docker container) because SetV1 does nothing in this case.

We could fix the panic, but it doesn't make sense to run the test at
all.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-30 11:18:01 -07:00
Akihiro Suda 1aeefd9cbd Merge pull request #4291 from kolyshkin/codespell-2.3.0
Fix codespell warnings
2024-05-25 02:10:32 +09:00
Kir Kolyshkin 177c7d4f59 Fix codespell warnings
./features.go:30: tru ==> through, true
...
./utils_linux.go:147: infront ==> in front

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-23 22:02:45 -07:00
Akihiro Suda 68564eecde Merge pull request #4258 from kolyshkin/fix-4094
libct/cg/fs: fix setting rt_period vs rt_runtime
2024-05-21 11:21:53 +09:00
Akihiro Suda 492dc558cd Merge pull request #4276 from kolyshkin/arm-cpt-test-fixes
fix checkpoint/restore tests on actuated-arm64
2024-05-20 10:09:11 +09:00
Akihiro Suda 3d07cbc9a1 Merge pull request #4282 from lifubang/fix-comment-ClearRlimitNofileCache
Add a correct GoDoc format comment for ClearRlimitNofileCache
2024-05-16 22:16:53 +09:00
lifubang a35f7d8093 fix comments for ClearRlimitNofileCache
Signed-off-by: lifubang <lifubang@acmcoder.com>
2024-05-16 20:34:43 +08:00
Sebastiaan van Stijn 4e8cf2793a Merge pull request #4280 from austinvazquez/vendor-x-net-0.24.0
vendor: golang.org/x/net@v0.24.0
2024-05-16 09:38:29 +02:00
Austin Vazquez 6ab3d8ad1e vendor: golang.org/x/net@v0.24.0
This change vendors golang.org/x/net@v0.24.0 to silence security
warnings for https://pkg.go.dev/vuln/GO-2024-2687.

runc takes a dependency on net/bpf only and would not be impacted by the
HTTP2 vulnerability reported.

Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-05-14 13:16:18 +00:00
lfbzhm 9d02c20df7 Merge pull request #4279 from kolyshkin/rm-fixme
.cirrus.yml: rm FIXME from rootless fs on CentOS 7
2024-05-14 17:57:55 +08:00
Kir Kolyshkin f805206611 libct/cg/fs: fix setting rt_period vs rt_runtime
The issue is the same as in commit 1b2adcf but for RT scheduler;
the fix is also the same.

Test case by ls-ggg.

Co-authored-by: ls-ggg <335814617@qq.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-13 17:47:39 -07:00
Kir Kolyshkin e5e8f33695 .cirrus.yml: rm FIXME from rootless fs on CentOS 7
I tried to fix it, but it looks like older CentOS 7 kernel is the
ultimate reason why it doesn't work.

So, remove FIXME and add some explanation.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-13 17:47:17 -07:00
Kir Kolyshkin 36be6d0510 libct/int: checkpoint test: skip pre-dump if not avail
Since we're now testing on ARM, the test case fails when trying to do
pre-dump since MemTrack is not available.

Skip the pre-dump part if so.

This also reverts part of commit 3f4a73d6 as it is no longer needed
(now, instead of skipping the whole test, we're just skipping the
pre-dump).

[Review with --ignore-all-space]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-10 11:04:58 -07:00
Kir Kolyshkin e42d981d67 libct/int: rm double logging in checkpoint_test
Since commit c77aaa3f the tail of criu log is printed by runc, so
there's no need to do the same thing in tests.

This also fixes a test failure on ARM where showLog fails (because
there's no log file) and thus the conditional t.Skip is not called.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-09 15:18:29 -07:00
Kir Kolyshkin 62a314656a libct/int/cpt: simplify test pre-check
criu check --feature userns also tests for the /proc/self/ns/user
presense, so remove the redundant check, and simplify the error message.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-09 15:18:29 -07:00
Kir Kolyshkin e676dac523 libct/criu: simplify checkCriuFeatures
Since criu 2.12, rpcOpts is not needed when checking criu features.
As we requires criu >= 3.0 in Checkpoint, we can remove rpcOpts.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-09 15:18:29 -07:00
Kir Kolyshkin f6a8c9b816 libct: checkCriuFeatures: return underlying error
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-09 15:18:29 -07:00
Akihiro Suda e8bec1ba40 Merge pull request #4265 from lifubang/fix-set-RLIMIT_NOFILE-race
Fix set nofile rlimit error
2024-05-09 09:44:53 +09:00
lifubang 4ea0bf88fd update/add some tests for rlimit
issues:
https://github.com/opencontainers/runc/issues/4195
https://github.com/opencontainers/runc/pull/4265#discussion_r1588599809

Signed-off-by: lifubang <lifubang@acmcoder.com>
2024-05-08 10:57:10 +00:00
ls-ggg da68c8e37b libct: clean cached rlimit nofile in go runtime
As reported in issue #4195, the new version(since 1.19) of go runtime
will cache rlimit-nofile. Before executing execve, the rlimit-nofile
of the process will be restored with the cache. In runc, this will
cause the rlimit-nofile set by the parent process for the container
to become invalid. It can be solved by clearing the cache.

Signed-off-by: ls-ggg <335814617@qq.com>
(cherry picked from commit f9f8abf310)
Signed-off-by: lifubang <lifubang@acmcoder.com>
2024-05-08 10:40:13 +00:00
lifubang a853a82677 runc exec: setupRlimits after syscall.rlimit.init() completed
Issue: https://github.com/opencontainers/runc/issues/4195
Since https://go-review.googlesource.com/c/go/+/476097, there is
a get/set race between runc exec and syscall.rlimit.init, so we
need to call setupRlimits after syscall.rlimit.init() completed.

Signed-off-by: lifubang <lifubang@acmcoder.com>
2024-05-08 10:40:07 +00:00
Aleksa Sarai 151f480cc0 merge #4268 into opencontainers/runc:main
Kir Kolyshkin (2):
  libct: fix a comment
  libct/system: rm Execv

LGTMs: AkihiroSuda cyphar
2024-05-08 16:34:13 +10:00
lfbzhm 6cf790cc94 Merge pull request #4275 from kolyshkin/bump-golangci-lint-action
ci/gha: bump golangci-lint-action from 5 to 6
2024-05-08 12:56:32 +08:00
Kir Kolyshkin f452f667c0 ci/gha: bump golangci-lint-action from 5 to 6
Note that github-actions output format is deprecated and no longer supported,
and it is also no longer needed since setup-go problem matcher already
handles default golangci-lint output format ("colored-line-number").

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-07 14:26:41 -07:00
Kir Kolyshkin bac506463d libct: fix a comment
Do not refer to the function which was removed.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-07 14:10:16 -07:00
Kir Kolyshkin dbd0c3349f libct/system: rm Execv
This is not used since commit dac41717.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-07 14:09:22 -07:00