Commit Graph

7648 Commits

Author SHA1 Message Date
Kir Kolyshkin 1018d8dc4d ci: show criu version in criu-dev testing
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 2a7ce15e68)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-10-20 10:53:39 -07:00
Kir Kolyshkin f6e408f744 ci: bump bats to 1.11.1
Bump bats to the version from Fedora 42 (used in "fedora" job), so we
have the same version everywhere.

This also fixes an issue introduced by commit d31e6b87 (which forgot to
bump bats in GHA CI), and adds a note to the yaml in order to avoid the
same issue in the future.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 6af1d637ba)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-10-20 10:53:39 -07:00
Kir Kolyshkin 13a5c4edf4 Merge pull request #4941 from lifubang/backport-4934-4917-4937
[1.4] ci: backport #4934 #4917 #4937
2025-10-16 10:25:45 -07:00
Kir Kolyshkin ae19971927 ci: only run lint-extra job on PRs to main
All the new code appears in main (not in the release branches),
and we only want extra linter rules to apply to new code.

Disable lint-extra job if the PR is not to the main branch.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 1c4dba693f)
Signed-off-by: lifubang <lifubang@acmcoder.com>
2025-10-16 07:00:09 +00:00
Kir Kolyshkin 8bb53e4241 ci: bump golangci-lint to v2.5
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 2aea8617ea)
Signed-off-by: lifubang <lifubang@acmcoder.com>
2025-10-16 06:59:54 +00:00
Kir Kolyshkin 52ee0fed30 all: format sources with gofumpt v0.9.1
Since gofumpt v0.9.0 there's a new formatting rule to "clothe" any naked
returns.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit b2f8a74de5)
Signed-off-by: lifubang <lifubang@acmcoder.com>
2025-10-16 06:59:38 +00:00
Akihiro Suda 61070cc0b5 CI: remove deprecated lima-vm/lima-actions/ssh
`lima-vm/lima-actions/ssh` is now merged into
`lima-vm/lima-actions/setup`.

https://github.com/lima-vm/lima-actions/releases/tag/v1.1.0

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
(cherry picked from commit c0e6f42427)
Signed-off-by: lifubang <lifubang@acmcoder.com>
2025-10-16 06:59:22 +00:00
lfbzhm 1984e2c256 Merge pull request #4936 from cyphar/1.4-fix-prepare-cgroup-fd-close
[1.4] libct: close child fds on prepareCgroupFD error
2025-10-16 08:59:19 +08:00
Kir Kolyshkin 42b405d598 libct: refactor setnsProcess.start
Factor startWithCgroupFD out of start to reduce the start complexity.
This also implements a more future-proof way of calling p.comm.closeChild.

Co-authored-by: lifubang <lifubang@acmcoder.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 871052b791)
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2025-10-16 09:40:35 +11:00
Kir Kolyshkin e8e22ae15c libct: close child fds on prepareCgroupFD error
The (*setns).start is supposed to close child fds once the child has
started, or upon an error. Commit 5af4dd4e6 added a bug -- child fds
are not closed if prepareCgroupFD fails.

Fix by adding a missing call to closeChild.

I'm not sure how to write a good test case for it. Found when working
on PR 4928 (and tested in there).

Fixes: 5af4dd4e6
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 4e262509b8)
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2025-10-16 09:40:33 +11:00
Rodrigo Campos bd6021d990 Merge pull request #4927 from cyphar/1.4-cpuset-fill
[1.4] libct: switch to (*CPUSet).Fill
2025-10-09 11:14:50 -03:00
Aleksa Sarai 5aa229f74a [1.4] libct: switch to (*CPUSet).Fill
Now that we've updated to golang.org/x/sys@v0.37.0, CPUSet has a Fill
helper that does the equivalent to our underflow trick to make setting
all CPUs efficient.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
(cherry picked from commit 93f9a392cf)
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2025-10-09 18:44:14 +11:00
Aleksa Sarai 18fbdbe91c [1.4] deps: update to golang.org/x/sys@v0.37.0
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2025-10-09 18:42:26 +11:00
Aleksa Sarai 2e3b2fb70c merge #4922 into opencontainers/runc:release-1.4
Aleksa Sarai (3):
  VERSION: back to development
  VERSION: release v1.4.0-rc.2
  CHANGELOG: add note about cpu shares changes

LGTMs: kolyshkin lifubang AkihiroSuda
2025-10-09 18:40:13 +11:00
Aleksa Sarai 46331735c2 VERSION: back to development
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2025-10-09 15:55:43 +11:00
Aleksa Sarai 8aeb2a4bdd VERSION: release v1.4.0-rc.2
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
v1.4.0-rc.2
2025-10-09 14:35:07 +11:00
Aleksa Sarai a2f2cf31f8 CHANGELOG: add note about cpu shares changes
This was a notable change in v1.4.0-rc.1 but this was not sufficiently
well-signposted in our changelog.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2025-10-09 14:35:06 +11:00
Aleksa Sarai b8f6fdb95a merge #4923 into opencontainers/runc:release-1.4
Joshua Rogers (1):
  fix(seccompagent): close received FDs, not loop index

LGTMs: lifubang cyphar
2025-10-09 14:29:17 +11:00
Joshua Rogers 0b8a41e38f fix(seccompagent): close received FDs, not loop index
Prevents accidentally closing 0/1/2 on error paths.

Signed-off-by: Joshua Rogers <MegaManSec@users.noreply.github.com>
(cherry picked from commit 8c1b3f9608)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-10-08 16:44:42 -07:00
lfbzhm bf5aeecc03 Merge pull request #4921 from marquiz/release-1.4
[1.4] libcontainer/intelrdt: add support for EnableMonitoring field
2025-10-08 17:05:38 +08:00
lfbzhm 938693ba89 Merge pull request #4920 from cyphar/1.4-cgroup-clone-into-cgroup
[1.4] runc exec: use CLONE_INTO_CGROUP
2025-10-08 16:02:15 +08:00
Markus Lehtonen 1f9157d68d libcontainer/intelrdt: add support for EnableMonitoring field
The linux.intelRdt.enableMonitoring field enables the creation of
a per-container monitoring group. The monitoring group is removed when
the container is destroyed.

Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
(cherry picked from commit 7aa4e1a63d)
2025-10-08 10:46:21 +03:00
Kir Kolyshkin d792f9fdb1 [1.4] runc exec: use CLONE_INTO_CGROUP when available
It makes sense to make runc exec benefit from clone2(CLONE_INTO_CGROUP),
if it is available. Since it requires a recent kernel and might not work,
implement a fallback to older way of joining the cgroup.

Based on:
 - https://go-review.googlesource.com/c/go/+/417695
 - https://github.com/coreos/go-systemd/pull/458
 - https://github.com/opencontainers/cgroups/pull/26
 - https://github.com/opencontainers/runc/pull/4822

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 5af4dd4e64)
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2025-10-08 18:40:18 +11:00
Kir Kolyshkin 3338251984 [1.4] libct: use manager.AddPid to add exec to cgroup
The main benefit here is when we are using a systemd cgroup driver,
we actually ask systemd to add a PID, rather than doing it ourselves.
This way, we can add rootless exec PID to a cgroup.

This requires newer opencontainers/cgroups and coreos/go-systemd.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 37b5acc2d7)
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2025-10-08 18:40:17 +11:00
Kir Kolyshkin 7db9930fab [1.4] libct: move exec sub-cgroup handling down the line
Remove cgroupPaths field from struct setnsProcess, because:
 - we can get base cgroup paths from p.manager.GetPaths();
 - we can get sub-cgroup paths from p.process.SubCgroupPaths.

But mostly because we are going to need separate cgroup paths when
adopting cgroups.AddPid.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 5730a141f1)
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2025-10-08 18:38:56 +11:00
Kir Kolyshkin f19a4c7122 [1.4] libct: split addIntoCgroup into V1 and V2
The main idea is to maintain the code separately (and eventually kill V1
implementation).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 5560020cbb)
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2025-10-08 18:38:56 +11:00
Kir Kolyshkin 207a497ce1 [1.4] libct: factor out addIntoCgroup from setnsProcess.start
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit b39e0d6468)
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2025-10-08 18:38:56 +11:00
Kir Kolyshkin c443aee760 [1.4] script/setup_rootless.sh: chown nit
This fixes the following warning (seen on Fedora 42 and Ubuntu 24.04):

	+ sudo chown -R rootless.rootless /home/rootless
	chown: warning: '.' should be ':': ‘rootless.rootless’

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 7d6848f883)
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2025-10-08 18:38:55 +11:00
Kir Kolyshkin e470a84243 Merge pull request #4915 from cyphar/1.4-memory-policy
[1.4] Add memory policy and schemata support
2025-10-08 00:03:01 -07:00
Antti Kervinen 910f134598 [1.4] Add memory policy support
Implement support for Linux memory policy in OCI spec PR:
https://github.com/opencontainers/runtime-spec/pull/1282

Signed-off-by: Antti Kervinen <antti.kervinen@intel.com>
(cherry picked from commit eda7bdf80c)
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2025-10-08 13:55:50 +11:00
Markus Lehtonen 12ed7f7315 [1.4] events/intelrdt: report full schemata
Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
(cherry picked from commit 7be025fff3)
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2025-10-08 13:55:50 +11:00
Markus Lehtonen 517e7996d2 [1.4] libcontainer/intelrdt: add support for Schemata field
Implement support for the linux.intelRdt.schemata field of the spec.
This allows management of the "schemata" file in the resctrl group in a
generic way.

Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
(cherry picked from commit 41553216ee)
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2025-10-08 13:55:50 +11:00
Markus Lehtonen 3009f9d7d0 [1.4] libcontainer/intelrdt: refactor tests
Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
(cherry picked from commit 3867f826da)
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2025-10-08 13:55:50 +11:00
Markus Lehtonen a0858eaf3b [1.4] Update runtime-spec
Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
(cherry picked from commit 74c5436b7d)
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2025-10-08 05:29:27 +11:00
lfbzhm 82561ccdfc Merge pull request #4911 from cyphar/1.4-remove-libct-userns 2025-10-04 22:08:50 +08:00
Aleksa Sarai fb0268a004 libcontainer: remove deprecated package "userns"
This package was marked deprecated in commit 9b60a93cf3
("libcontainer/userns: migrate to github.com/moby/sys/userns"), which
was included in runc 1.2. Users have thus had a year to migrate to
github.com/moby/sys/userns and it's okay for us to remove this wrapper
package.

(Cherry-pick of commit e4f99b5c95b8f49434452edff82e73547c7a8252.)

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2025-10-04 14:39:19 +10:00
Aleksa Sarai f3e37f18e2 merge #4903 into opencontainers/runc:release-1.4
Li Fubang (2):
  test: runc run with personality syscall blocked by seccomp
  libct: setup personality before initializing seccomp

LGTMs: AkihiroSuda cyphar
2025-09-29 12:25:18 +10:00
lifubang edef954c3a test: runc run with personality syscall blocked by seccomp
Signed-off-by: lifubang <lifubang@acmcoder.com>
(cherry picked from commit 57f1bef422)
Signed-off-by: lifubang <lifubang@acmcoder.com>
2025-09-27 08:20:24 +00:00
lifubang a6efa62d5e libct: setup personality before initializing seccomp
Set the process personality early to ensure it takes effect before
seccomp is initialized. If seccomp filters are applied first and they
block personality-related system calls (e.g., `personality(2)`),
subsequent attempts to set the personality will fail.

Signed-off-by: lifubang <lifubang@acmcoder.com>
(cherry picked from commit f7dda6e6dc)
Signed-off-by: lifubang <lifubang@acmcoder.com>
2025-09-27 08:20:04 +00:00
Rodrigo Campos 1128fdb636 Merge pull request #4894 from rata/64k-alignment-v1.4
[1.4] tests/int/cgroups: Use 64K aligned limits for memory.max
2025-09-18 00:50:50 -03:00
donettom-1 b72f4a8d97 tests/int/cgroups: Use 64K aligned limits for memory.max
When a non–page-aligned value is written to memory.max, the kernel aligns it
down to the nearest page boundary. On systems with a page size greater
than 4K (e.g., 64K), this caused failures because the configured
memory.max value was not 64K aligned.

This patch fixes the issue by explicitly aligning the memory.max value
to 64K. Since 64K is also a multiple of 4K, the value is correctly
aligned on both 4K and 64K page size systems.

However, this approach will still fail on systems where the hardcoded
memory.max value is not aligned to the system page size.

Fixes: https://github.com/opencontainers/runc/issues/4841

Signed-off-by: Vishal Chourasia <vishalc@linux.ibm.com>
Signed-off-by: Donet Tom <donettom@linux.ibm.com>
(cherry picked from commit 830c479ae2)
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2025-09-17 09:13:39 +02:00
Rodrigo Campos 81fe240c7c Merge pull request #4892 from tych0/ucounts-1.4
[1.4] libcontainer/validator: allow setting user.* sysctls inside userns
2025-09-15 12:41:27 -03:00
Tycho Andersen bce56e0072 libcontainer/validator: allow setting user.* sysctls inside userns
These sysctls are all per-userns (termed `ucounts` in the kernel code) are
settable with CAP_SYS_RESOURCE in the user namespace.

Signed-off-by: Tycho Andersen <tycho@tycho.pizza>
(cherry picked from commit 70d88bc449)
2025-09-15 08:46:53 -06:00
Aleksa Sarai 6297cb167d [1.4] VERSION: back to development
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2025-09-05 23:51:06 +10:00
Aleksa Sarai b2ec7f9201 VERSION: release v1.4.0-rc.1
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
v1.4.0-rc.1
2025-09-05 19:03:49 +10:00
Aleksa Sarai 081b8c25b3 CHANGELOG: forward-port v1.3.1 changelog
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2025-09-05 19:03:49 +10:00
Aleksa Sarai 1931ebf739 CHANGELOG: forward-port v1.2.7 changelog
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2025-09-05 19:03:49 +10:00
Akihiro Suda 95b448addf Merge pull request #4882 from opencontainers/dependabot/github_actions/actions/setup-go-6
build(deps): bump actions/setup-go from 5 to 6
2025-09-05 16:05:48 +09:00
dependabot[bot] edc2eb60f3 build(deps): bump actions/setup-go from 5 to 6
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5 to 6.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-05 04:02:34 +00:00
Kir Kolyshkin 8483c697a7 Merge pull request #4735 from ningmingxiao/fix_start
bug:fix runc delete run before delete exec.fifo
2025-09-02 22:35:59 -07:00