7836 Commits

Author SHA1 Message Date
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
Kir Kolyshkin 424745c6e6 Merge pull request #4877 from cyphar/remove-libct-user
libct: user: remove deprecated module
2025-09-02 22:25:39 -07:00
Kir Kolyshkin ba97aebfc0 Merge pull request #4874 from kolyshkin/ci-run-modernize
ci/validate: add modernize run
2025-09-02 22:23:59 -07:00
Aleksa Sarai 779c9e1d9a libct: user: remove deprecated module
libcontainer/user was marked as deprecated in d9ea71bf96 ("deprecate
libcontainer/user") and users have had plenty of time to migrate to
github.com/moby/sys/user.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2025-09-03 00:45:15 +10:00
Kir Kolyshkin c04d9c446d ci/validate: add modernize run
Modernize tool [1] basically ensures that the new language features and
packages are used across the code.

The reason to run it in CI is to ensure that
 - PR authors use modern code;
 - our code is modern whether we bump Go version in go.mod.

Shove it into go-fix job which already does a similar thing
but for 'go-fix' and rename the whole job to modernize.

[1]: https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-08-29 15:24:04 -07:00
Rodrigo Campos 7a982f4282 Merge pull request #4854 from marquiz/devel/rdt-root-clos
libcontainer/intelrdt: support explicit assignment to root CLOS
2025-08-29 07:17:43 -03:00
Markus Lehtonen 762819496e libcontainer/configs/validate: add doc.go
Add package comment to make revive pass muster.

Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
2025-08-29 12:36:04 +03:00
Markus Lehtonen ba68a17ad1 libcontainer/configs: add validator unit tests for intelRdt
Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
2025-08-28 14:11:07 +03:00
Markus Lehtonen b8a83ac255 libcontainer/intelrdt: support explicit assignment to root CLOS
Makes it possible e.g. to enable monitoring
(linux.intelRdt.enableMonitoring) without creating a CLOS (resctrl
group) for the container.

Implements https://github.com/opencontainers/runtime-spec/pull/1289.

Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
2025-08-28 14:08:37 +03:00
Akihiro Suda d845c4ae24 Merge pull request #4868 from kolyshkin/test-nits
Fix bogus test failures when running with RUNC=$(pwd)/runc.smth
2025-08-28 14:10:00 +09:00
Rodrigo Campos f8bb8ace3c Merge pull request #4851 from kolyshkin/go124-min
Switch to Go 1.24 as a min version, bump CI, modernize sources
2025-08-27 23:33:58 -03:00
Kir Kolyshkin 89e59902c4 Modernize code for Go 1.24
Brought to you by

	modernize -fix -test ./...

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-08-27 19:11:02 -07:00
Kir Kolyshkin b042b6d455 types/events: use omitzero where appropriate
In these cases, omitempty doesn't really work so it is useless,
but omitzero actually works.

As a result, output of `runc events` may omit these fields if all they
contain are zeroes.

NOTE this might be a breaking change.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-08-27 19:11:02 -07:00