Commit Graph

6945 Commits

Author SHA1 Message Date
Kir Kolyshkin ee601b87f9 MAINTAINERS_GUIDE: rm chief maintainer role
Since Michael Crosby is stepping down, and we don't want to nominate
someone else to be a chief maintainer, let's remove the position.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-24 16:50:52 -07:00
Kir Kolyshkin d6563f6bcd MAINTAINERS: move crosbymichael to EMERITUS
I talked to Michael, he says he is stepping down as a maintainer, being
busy with other stuff.

Thank you for all the hard work that you did!

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-23 12:53:57 -07:00
Kir Kolyshkin 90ebcca8f1 Merge pull request #4314 from kolyshkin/maint-rata
MAINTAINERS: add Rodrigo Campos

LGTMs: crosbymichael mrunalp dqminh hqhq cyphar AkihiroSuda kolyshkin thaJeztah lifubang
Vote: +8 -0 #1
2024-06-20 17:00:07 -07:00
Akihiro Suda 8256a9384f Merge pull request #4322 from lifubang/changelog-sortby-ver
Put the changelog of v1.1.13 after v1.2.0-rc.1
2024-06-20 14:55:10 +09:00
lfbzhm ad976aa155 put the changelog of v1.1.13 after v1.2.0-rc.1
Signed-off-by: lfbzhm <lifubang@acmcoder.com>
2024-06-19 14:09:02 +00:00
Sebastiaan van Stijn fd5675e386 Merge pull request #4321 from lifubang/update-changelog-release-1.1.13
update changelog after v1.1.13 released
2024-06-14 01:35:57 +02:00
Akihiro Suda ac26d3d158 Merge pull request #4320 from kolyshkin/nits
Some nits I found from older PRs
2024-06-14 07:45:34 +09:00
lfbzhm 4e2d7c0a6e update changelog after v1.1.13 released
Signed-off-by: lfbzhm <lifubang@acmcoder.com>
2024-06-13 22:45:00 +00:00
Kir Kolyshkin 2cb46c6e0d script/keyring_validate.sh: fix a typo
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-13 08:03:08 -07:00
Kir Kolyshkin d6e427e1ea runc exec: avoid stuttering in error messages
An error from strconv.Atoi already contains the text it fails to parse.
Because of that, errors look way too verbose, e.g.:

	[root@kir-rhat runc-tst]# ./runc exec --user 1:1:1 2345 true
	ERRO[0000] exec failed: parsing 1:1 as int for gid failed: strconv.Atoi: parsing "1:1": invalid syntax

With this patch, the error looks like this now:

	[root@kir-rhat runc]# ./runc exec --user 1:1:1 2345 true
	ERRO[0000] exec failed: bad gid: strconv.Atoi: parsing "1:1": invalid syntax

Still not awesome, but better.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-12 21:03:10 -07:00
Kir Kolyshkin a6d46ed1a7 runc exec: improve options parsing
1. Do not ask for the same option value twice.

2. For tty, we always want false, unless specified, and this is what
   GetBool gets us.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-12 20:59:01 -07:00
lfbzhm 9d600197be Merge pull request #4271 from kolyshkin/two-inits
libct.Start: fix locking, do not allow a second container init
2024-06-11 18:37:40 +08:00
Kir Kolyshkin 42cea2ecb4 libct: don't allow to start second init process
By definition, every container has only 1 init (i.e. PID 1) process.

Apparently, libcontainer API supported running more than 1 init, and
at least one tests mistakenly used it.

Let's not allow that, erroring out if we already have init. Doing
otherwise _probably_ results in some confusion inside the library.

Fix two cases in libct/int which ran two inits inside a container.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-10 22:30:03 -07:00
Kir Kolyshkin e3e1072575 libct: fix locking in Start/Run/Exec
1. The code to call c.exec from c.Run was initially added by commit
   3aacff695. At the time, there was a lock in c.Run. That lock was
   removed by commit bd3c4f84, which resulted in part of c.Run executing
   without the lock.

2. All the Start/Run/Exec calls were a mere wrappers for start/run/exec
   adding a lock, but some more code crept into Start at some point,
   e.g. by commits 805b8c73 and 108ee85b8. Since the reason mentioned in
   commit 805b8c73 is no longer true after refactoring, we can fix this.

Fix both issues by moving code out of wrappers, and adding locking into
c.Run.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-10 22:30:03 -07:00
Kir Kolyshkin 304a4c0fee libct: createExecFifo: rm unneeded os.Stat
In case file already exists, mknod(2) will return EEXIST.

This os.Stat call was (inadvertently?) added by commit 805b8c73.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-10 22:30:03 -07:00
lfbzhm 349e5ab7c1 Merge pull request #4283 from kolyshkin/revert-cpu-aff
Revert "Set temporary single CPU affinity before cgroup cpuset transition"
2024-06-10 06:54:53 +08:00
Kir Kolyshkin 1c505fffdc Revert "Set temporary single CPU affinity..."
There's too much logic here figuring out which CPUs to use. Runc is a
low level tool and is not supposed to be that "smart". What's worse,
this logic is executed on every exec, making it slower. Some of the
logic in (*setnsProcess).start is executed even if no annotation is set,
thus making ALL execs slow.

Also, this should be a property of a process, rather than annotation.

The plan is to rework this.

This reverts commit afc23e3397.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-10 06:31:03 +08:00
Kir Kolyshkin 67a1477959 Merge pull request #4285 from kolyshkin/f40
Vagrantfile.fedora: bump to F40
2024-06-09 15:26:38 -07:00
Akihiro Suda 30a7d9b863 Merge pull request #4186 from kolyshkin/multi-line
libct/cg: write unified resources line by line
2024-06-10 06:27:07 +09:00
Kir Kolyshkin f8f1bc9a30 Vagrantfile.fedora: bump to F40
Get the image from Fedora directly.

Also, remove the comment about cgroup v2 as it is also tested on Ubuntu
22.04 now.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-09 14:15:18 -07:00
Kir Kolyshkin 771903608c libct/cg: write unified resources line by line
It has been pointed out that some controllers can not accept multiple
lines of output at once. In particular, io.max can only set one device
at a time.

Practically, the only multi-line resource values we can get come from
unified.* -- let's write those line by line.

Add a test case.

Reported-by: Tao Shen <shentaoskyking@gmail.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-09 14:01:45 -07:00
Akihiro Suda 30b7b63974 Merge pull request #4311 from lifubang/fix-debug-msg-in-nsexec
fix a debug msg for user ns in nsexec
2024-06-08 19:57:50 +09:00
Akihiro Suda 865224d4e3 Merge pull request #4292 from kolyshkin/go122
Stop blacklisting Go 1.22+, drop Go < 1.21 support, use Go 1.22 in CI
2024-06-08 18:01:30 +09:00
lfbzhm a35a4c6807 Merge pull request #4189 from kolyshkin/fix-gpg-validate
script/*: fix gpg usage wrt keyboxd
2024-06-08 08:19:03 +08:00
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
Kir Kolyshkin 3019e842de libct/cg: use clear built-in
As we no longer support Go < 1.21.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-07 10:18:59 -07:00
Kir Kolyshkin b7fdd524cb libct: use slices package
As we're no longer supporting Go < 1.21.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-07 10:18:59 -07:00
Kir Kolyshkin a1e87f8d76 libct: rm eaccess
It is not needed since Go 1.20 (which was released in February 2023 and
is no longer supported since February 2024).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-07 10:18:59 -07:00
Kir Kolyshkin 6b2eb52fb0 go.mod,README: require Go 1.21
Go 1.20 was released in February 2023 and is no longer supported since
February 2024. Time to move on.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-07 10:18:59 -07:00
Kir Kolyshkin 17380da277 Dockerfile: switch to Go 1.22 and Debian 12
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-07 10:18:59 -07:00
Kir Kolyshkin a3302f2054 ci: switch to go 1.22 as main version
Now when Go 1.22.4 is out it should no longer be a problem.

Leave Go 1.21 for CentOS testing (CentOS 7 and 8 have older glibc)
and Dockerfile (Debian 11 have older glibc).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-07 10:18:59 -07:00
Kir Kolyshkin e660ef61a5 libct/nsenter: stop blacklisting go 1.22+
Go 1.23 includes a fix (https://go.dev/cl/587919) so go1.23.x can be
used. This fix is also backported to 1.22.4, so go1.22.x can also be
used (when x >= 4). Finally, for glibc >= 2.32 it doesn't really matter.

Add a note about Go 1.22.x > 1.22.4 to README as well.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-07 10:18:56 -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
lfbzhm 24c2d28d1f fix a debug msg for user ns in nsexec
Signed-off-by: lfbzhm <lifubang@acmcoder.com>
2024-06-06 14:30:29 +00: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
Kir Kolyshkin 760105ab11 script/*: fix gpg usage wrt keyboxd
I used script/keyring_validate.sh, which gave me this error:

> [*] User cyphar in runc.keyring is not a maintainer!

Apparently, when gnupg 2.4.1+ sees a fresh install (i.e. no ~/.gnupg
directory), it configures itself to use keyboxd instead of keyring
files, and when just silently ignores options like --keyring and
--no-default-keyring, working with keyboxd all the time.

The only way I found to make it not use keyboxd is to set --homedir.
Let's do that when we explicitly want a separate keyring.

Similar change is made to script/release_key.sh.

Also, change "--import --import-options=show-only" to "--show-keys"
which is a shortcut. When using this, there is no need to protect
the default keyring since this command does not read or modify it.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-05 17:05:05 -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