7632 Commits

Author SHA1 Message Date
Kir Kolyshkin
7d81b21c1a Merge pull request #4900 from lifubang/fix-Personality-seccomp
libct: setup personality before initializing seccomp
2025-09-25 16:59:28 -07:00
lifubang
57f1bef422 test: runc run with personality syscall blocked by seccomp
Signed-off-by: lifubang <lifubang@acmcoder.com>
2025-09-25 09:54:08 +00:00
lifubang
f7dda6e6dc 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>
2025-09-25 09:39:36 +00:00
Kir Kolyshkin
77ead42c9f Merge pull request #4822 from kolyshkin/add-pid
runc exec: use manager.AddPid
2025-09-17 18:43:25 -07:00
Rodrigo Campos
184024da25 Merge pull request #4893 from donettom-1/runc_cgroup_test_fix_for_ppc64
tests/int/cgroups: Use 64K aligned limits for memory.max
2025-09-17 04:13:33 -03:00
Kir Kolyshkin
37b5acc2d7 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>
2025-09-16 13:31:16 -07:00
Kir Kolyshkin
5730a141f1 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>
2025-09-16 13:27:56 -07:00
Kir Kolyshkin
5560020cbb 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>
2025-09-16 13:27:56 -07:00
Kir Kolyshkin
b39e0d6468 libct: factor out addIntoCgroup from setnsProcess.start
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-09-16 13:27:56 -07:00
Kir Kolyshkin
7d6848f883 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>
2025-09-16 13:27:56 -07:00
Kir Kolyshkin
b5cb56413c Merge pull request #4830 from marquiz/devel/rdt-schemata-field
libcontainer/intelrdt: add support for Schemata field
2025-09-16 13:23:43 -07:00
donettom-1
830c479ae2 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>
2025-09-16 17:31:35 +05:30
Rodrigo Campos
f3ea522a28 Merge pull request #4889 from tych0/allow-ucounts
libcontainer/validator: allow setting user.* sysctls inside userns
2025-09-15 09:18:58 -03:00
Markus Lehtonen
7be025fff3 events/intelrdt: report full schemata
Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
2025-09-15 15:09:06 +03:00
Markus Lehtonen
41553216ee 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>
2025-09-15 15:09:06 +03:00
Tycho Andersen
70d88bc449 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>
2025-09-12 12:40:44 -06:00
dependabot[bot]
55c90aaf02 Merge pull request #4888 from opencontainers/dependabot/go_modules/golang.org/x/net-0.44.0 2025-09-10 07:34:52 +00:00
dependabot[bot]
ffe6d3a3c8 build(deps): bump golang.org/x/net from 0.43.0 to 0.44.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.43.0 to 0.44.0.
- [Commits](https://github.com/golang/net/compare/v0.43.0...v0.44.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-version: 0.44.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 06:50:38 +00:00
Akihiro Suda
441d6f7528 Merge pull request #4887 from opencontainers/dependabot/go_modules/google.golang.org/protobuf-1.36.9
build(deps): bump google.golang.org/protobuf from 1.36.8 to 1.36.9
2025-09-10 15:49:38 +09:00
dependabot[bot]
cbf8a4d933 build(deps): bump google.golang.org/protobuf from 1.36.8 to 1.36.9
Bumps google.golang.org/protobuf from 1.36.8 to 1.36.9.

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 04:02:44 +00:00
Rodrigo Campos
1d80c2f9ad Merge pull request #4885 from opencontainers/dependabot/go_modules/golang.org/x/sys-0.36.0
build(deps): bump golang.org/x/sys from 0.35.0 to 0.36.0
2025-09-08 11:57:32 -03:00
dependabot[bot]
527d2e668f build(deps): bump golang.org/x/sys from 0.35.0 to 0.36.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.35.0 to 0.36.0.
- [Commits](https://github.com/golang/sys/compare/v0.35.0...v0.36.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-version: 0.36.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 04:02:59 +00:00
Rodrigo Campos
2998f90507 Merge pull request #4883 from opencontainers/dependabot/github_actions/actions/github-script-8
build(deps): bump actions/github-script from 7 to 8
2025-09-05 12:51:27 -03:00
Aleksa Sarai
650afdde5f merge #4881 into opencontainers/runc:main
Aleksa Sarai (4):
  VERSION: back to development
  VERSION: release v1.4.0-rc.1
  CHANGELOG: forward-port v1.3.1 changelog
  CHANGELOG: forward-port v1.2.7 changelog

LGTMs: kolyshkin rata AkihiroSuda
2025-09-05 23:48:59 +10:00
Aleksa Sarai
77367fca1f VERSION: back to development
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2025-09-05 19:03:49 +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]
9408f6643d build(deps): bump actions/github-script from 7 to 8
Bumps [actions/github-script](https://github.com/actions/github-script) from 7 to 8.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-05 04:02:37 +00: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
Markus Lehtonen
3867f826da libcontainer/intelrdt: refactor tests
Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
2025-08-28 13:42:10 +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
Kir Kolyshkin
26602650ad Add go 1.25, require go 1.24
Now that Go 1.25 is out, let's switch to go 1.24.0 as a minimally
supported version, drop Go 1.23 and add Go 1.25 to CI matrix.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-08-27 19:11:01 -07:00
Kir Kolyshkin
237cc9806a libct/sys/rlimit_linux: drop go:build tag
This is not needed since commit 16d73367 which sets 1.23 to be a
minimally required Go version.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-08-27 19:09:58 -07:00
Kir Kolyshkin
a38f42ab87 tests/int/help: simplify and fix
1. In case runc binary file name is not runc, the test fails like
   below. The fix is to get the binary name from $RUNC.

	 ✗ runc command -h
	   (in test file tests/integration/help.bats, line 27)
	     `[[ ${lines[1]} =~ runc\ checkpoint+ ]]' failed
	   runc-go1.25.0-main checkpoint -h (status=0):
	   NAME:
	      runc-go1.25.0-main checkpoint - checkpoint a running container

2. Simplify the test by adding a loop for all commands. While at it, add
   a loop for -h --help as well.

3. Add missing commands (create, ps, features).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-08-27 18:08:51 -07:00
Kir Kolyshkin
c5e7bc8710 tests/int/selinux: fix for non-standard binary name
The setup in selinux.bats assumes $RUNC binary name ends in runc, and
thus it fails when we run it like this:

	sudo -E RUNC=$(pwd)/runc.patched bats tests/integration/selinux.bats

Fix is easy.

Fixes: b39781b06 ("tests/int: add selinux test case")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-08-27 18:08:51 -07:00
Aleksa Sarai
cc8ab60e1a merge #4858 into opencontainers/runc:main
Aleksa Sarai (3):
  libct: reset CPU affinity by default
  tests: add RUNC_CMDLINE for tests incompatible with functions
  tests: add sane_run helper

LGTMs: lifubang kolyshkin
2025-08-28 10:53:20 +10:00